CSEngine
|
Public Types | |
enum | Type { TEX_2D = 0 , TEX_CUBE = 1 } |
Public Member Functions | |
STexture (Type type) | |
bool | LoadFile (const char *path) |
bool | LoadFromMemory (const unsigned char *rawData, int length) |
virtual bool | Load (unsigned char *data) |
bool | ReloadFile (const char *path) |
bool | Reload (unsigned char *data) |
unsigned int | GetTextureID () const |
virtual bool | InitTexture (int width, int height, int channel=GL_RGB, int internalFormat=GL_RGB8, int glType=GL_UNSIGNED_BYTE) |
bool | InitTextureMipmap (int width, int height, int channel=GL_RGB, int internalFormat=GL_RGB8, int glType=GL_UNSIGNED_BYTE) |
virtual void | SetParameteri (int targetName, int value) const |
virtual void | SetParameterfv (int targetName, float *value) const |
void | Release () |
void | Exterminate () override |
virtual void | Bind (GLint location, int layout) |
void | GenerateMipmap () const |
Type | GetType () const |
void | SetType (Type type) |
int | getMWidth () const |
int | getMHeight () const |
Public Member Functions inherited from CSE::SResource | |
SResource (bool isRegister) | |
SResource (const SResource *resource, bool isRegister) | |
void | SetName (std::string name) |
void | SetAbsoluteID (std::string id) |
std::string | GetName () const |
std::string | GetAbsoluteID () const |
AssetMgr::AssetReference * | GetAssetReference (std::string hash="") const |
void | LinkResource (AssetMgr::AssetReference *asset) |
void | LinkResource (std::string name) |
void | SetHash (std::string &hash) override |
Public Member Functions inherited from CSE::SObject | |
SObject (bool isRegister) | |
virtual void | SetUndestroyable (bool enable) |
virtual void | Destroy () |
virtual void | __FORCE_DESTROY__ () |
virtual std::string | GenerateMeta () |
std::string | GetHash () const |
Static Public Member Functions | |
static void | BindEmpty (GLint location, int layout, STexture::Type type=TEX_2D) |
Static Public Member Functions inherited from CSE::SResource | |
template<class T > | |
static T * | Create (const std::string &name) |
template<class T > | |
static T * | Create (const AssetMgr::AssetReference *asset) |
template<class T > | |
static T * | Get (std::string name) |
Protected Member Functions | |
void | Init (const AssetMgr::AssetReference *asset) override |
Protected Attributes | |
Type | m_type = TEX_2D |
int | m_targetGL = GL_TEXTURE_2D |
int | m_width = 0 |
int | m_height = 0 |
int | m_channels = 0 |
int | m_internalFormat = 0 |
int | m_glType = GL_UNSIGNED_BYTE |
unsigned int | m_texId = 0 |
Protected Attributes inherited from CSE::SObject | |
std::string | m_hash |
Definition at line 14 of file STexture.h.
enum CSE::STexture::Type |
Definition at line 16 of file STexture.h.
STexture::STexture | ( | ) |
Definition at line 15 of file STexture.cpp.
|
explicit |
Definition at line 22 of file STexture.cpp.
|
virtual |
Definition at line 110 of file STexture.cpp.
|
static |
Definition at line 193 of file STexture.cpp.
|
overridevirtual |
void STexture::GenerateMipmap | ( | ) | const |
Definition at line 179 of file STexture.cpp.
|
inline |
Definition at line 35 of file STexture.h.
STexture::Type STexture::GetType | ( | ) | const |
Definition at line 184 of file STexture.cpp.
|
overrideprotectedvirtual |
Implements CSE::SResource.
Definition at line 173 of file STexture.cpp.
|
virtual |
Definition at line 121 of file STexture.cpp.
bool STexture::InitTextureMipmap | ( | int | width, |
int | height, | ||
int | channel = GL_RGB , |
||
int | internalFormat = GL_RGB8 , |
||
int | glType = GL_UNSIGNED_BYTE |
||
) |
Definition at line 156 of file STexture.cpp.
|
virtual |
Definition at line 44 of file STexture.cpp.
bool STexture::LoadFile | ( | const char * | path | ) |
Definition at line 29 of file STexture.cpp.
bool STexture::LoadFromMemory | ( | const unsigned char * | rawData, |
int | length | ||
) |
Definition at line 39 of file STexture.cpp.
void STexture::Release | ( | ) |
Definition at line 99 of file STexture.cpp.
bool STexture::Reload | ( | unsigned char * | data | ) |
Definition at line 94 of file STexture.cpp.
bool STexture::ReloadFile | ( | const char * | path | ) |
Definition at line 89 of file STexture.cpp.
|
virtual |
Definition at line 168 of file STexture.cpp.
|
virtual |
Definition at line 163 of file STexture.cpp.
void STexture::SetType | ( | STexture::Type | type | ) |
Definition at line 188 of file STexture.cpp.
|
protected |
Definition at line 80 of file STexture.h.
|
protected |
Definition at line 82 of file STexture.h.
|
protected |
Definition at line 79 of file STexture.h.
|
protected |
Definition at line 81 of file STexture.h.
|
protected |
Definition at line 77 of file STexture.h.
|
protected |
Definition at line 84 of file STexture.h.
|
protected |
Definition at line 76 of file STexture.h.
|
protected |
Definition at line 78 of file STexture.h.