#include <StkTexture2D.h>
|
| Texture2D (TextureManager *tex_mgr, const std::string &filename, int texture_unit=0) |
|
| Texture2D (TextureManager *tex_mgr, const std::string &url, const std::string &asset_id, int texture_unit=0) |
|
| Texture2D (const std::string &filename, int texture_unit=0) |
|
| Texture2D (TextureManager *tex_mgr, std::shared_ptr< STK::Image > img, int texture_unit=0) |
|
| Texture2D (std::shared_ptr< STK::Image > img, int texture_unit=0) |
|
const std::string & | getFilename () const |
|
void | setImage (std::shared_ptr< STK::Image > img) |
|
void | setFilename (std::string &filename) |
|
int | getWidth () const |
|
int | getHeight () const |
|
std::shared_ptr< const STK::Image > | getImage () const |
|
bool | load () |
|
void | activate () override |
|
void | upload () override |
|
| Texture (TextureManager *tex_mgr, int texture_unit=0) |
|
| Texture (int texture_unit=0) |
|
GLuint | getHandle () const |
|
virtual void | activate ()=0 |
|
virtual void | upload ()=0 |
|
void | deactivate (GLenum target) |
|
void | unload (GLenum target) |
|
void | setHorizontalWrap (GLenum wrap) |
|
void | setVerticalWrap (GLenum wrap) |
|
void | setAnisotropy (float anisotropy) |
|
float | getAnisotropy () const |
|
GLenum | getHorizontalWrap () const |
|
GLenum | getVerticalWrap () const |
|
void | setMinFilter (GLenum min) |
|
void | setMagFilter (GLenum mag) |
|
GLenum | getMinFilter () const |
|
GLenum | getMagFilter () const |
|
int | getTextureUnit () const |
|
void | setTextureUnit (int texture_unit) |
|
void | setStatus (LoadState state) |
|
LoadState | getStatus () const |
|
void | clear () |
|
int64_t | getTimestamp () const |
|
|
static GLenum | getDummyTexture () |
|
static void | clearDummyTexture () |
|
static int | getNumActiveTextures () |
|
|
bool | loadInternal () override |
|
void | applyTextureParameters (GLenum target) |
|
void | getGLFormat (Image::Format fmt, GLenum &int_fmt, GLenum &data_fmt, GLenum &data_type) |
|
void | uploadTexture (const STK::Image &img, GLenum target) |
|
virtual bool | loadInternal ()=0 |
|
|
std::string | filename_ |
|
std::string | asset_id_ |
|
std::shared_ptr< STK::Image > | img_ |
|
int | width_ { 0 } |
|
int | height_ { 0 } |
|
TextureManager * | tex_mgr_ |
|
GLuint | handle_ |
|
int | texture_unit_ |
|
GLenum | vertical_wrap_ |
|
GLenum | horizontal_wrap_ |
|
GLenum | mag_filter_ |
|
GLenum | min_filter_ |
|
GLfloat | anisotropy_ |
|
int64_t | timestamp_ |
|
int | memsize_ |
|
std::atomic< int > | load_state_ |
|
|
enum | LoadState { INITIAL
, LOADING
, LOADED
, FAILED
} |
|
static int | s_numActiveTextures = 0 |
|
Texture2D - Short description. Detailed description.
◆ activate()
void Texture2D::activate |
( |
| ) |
|
|
overridevirtual |
Activate texture. This method will upload the texture data to OpenGL if not already done, and set this texture as current texture for all texture operations on the current texture unit.
Implements STK::Texture.
◆ load()
Load synchronously. This method will load the texture file from disk immediately. It will return true on success or false on failure. If a request for this texture is already pending in the asynchronous texture loader, the method will fail and return false.
◆ loadInternal()
bool Texture2D::loadInternal |
( |
| ) |
|
|
overrideprotectedvirtual |
Load from disk and upload to graphics card. This method should load the texture resources from disk.
Implements STK::Texture.
◆ upload()
void Texture2D::upload |
( |
| ) |
|
|
overridevirtual |
Upload texture data to graphics card. This requires a valid OpenGL context. If threaded GL and shared contexts are supported this can be done from the texture loader thread.
Implements STK::Texture.
The documentation for this class was generated from the following files:
- Native/SilentToolkit/StkScene/StkTexture2D.h
- Native/SilentToolkit/StkScene/StkTexture2D.cpp