CSEngine
|
Public Types | |
enum | Type { TEX_2D = 0 , TEX_CUBE = 1 , TEX_3D = 2 } |
Public Member Functions | |
RESOURCE_DEFINE_CONSTRUCTOR (STexture) | |
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) |
void | SetValue (std::string name_str, Arguments value) override |
std::string | PrintValue () const override |
![]() | |
SResource (std::string classType) | |
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 |
![]() | |
SObject (bool isRegister) | |
virtual void | SetUndestroyable (bool enable) |
virtual void | Destroy () |
std::string | GetHash () const |
![]() | |
![]() | |
ReflectionObject (std::string type) | |
void | SetClassType (std::string type) |
const char * | GetClassType () const |
bool | IsSameClass (const char *classType) const |
Static Public Member Functions | |
static void | BindEmpty (GLint location, int layout, STexture::Type type=TEX_2D) |
![]() | |
template<class T > | |
static T * | Create (const std::string &name) |
static SResource * | Create (const std::string &name, const std::string &classType) |
template<class T > | |
static T * | Create (const AssetMgr::AssetReference *asset) |
static SResource * | Create (const AssetMgr::AssetReference *asset, const std::string &classType) |
template<class T > | |
static T * | Get (std::string name) |
static SResource * | Get (std::string &name) |
![]() | |
static ReflectionObject * | NewObject (const 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_depth = 0 |
int | m_channels = 0 |
int | m_internalFormat = 0 |
int | m_glType = GL_UNSIGNED_BYTE |
unsigned int | m_texId = 0 |
![]() | |
std::string | m_hash |
![]() | |
std::string | m_class |
Additional Inherited Members | |
![]() | |
typedef std::vector< std::string > | Arguments |
Definition at line 14 of file STexture.h.
enum CSE::STexture::Type |
Definition at line 16 of file STexture.h.
|
explicit |
Definition at line 25 of file STexture.cpp.
|
virtual |
Definition at line 130 of file STexture.cpp.
|
static |
Definition at line 253 of file STexture.cpp.
|
overridevirtual |
void STexture::GenerateMipmap | ( | ) | const |
Definition at line 239 of file STexture.cpp.
|
inline |
Definition at line 35 of file STexture.h.
STexture::Type STexture::GetType | ( | ) | const |
Definition at line 244 of file STexture.cpp.
|
overrideprotectedvirtual |
Implements CSE::SResource.
Definition at line 198 of file STexture.cpp.
|
virtual |
Definition at line 141 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 181 of file STexture.cpp.
|
virtual |
Definition at line 53 of file STexture.cpp.
bool STexture::LoadFile | ( | const char * | path | ) |
Definition at line 32 of file STexture.cpp.
bool STexture::LoadFromMemory | ( | const unsigned char * | rawData, |
int | length ) |
Definition at line 42 of file STexture.cpp.
|
overridevirtual |
Implements CSE::VariableBinder.
Definition at line 276 of file STexture.cpp.
void STexture::Release | ( | ) |
Definition at line 119 of file STexture.cpp.
bool STexture::Reload | ( | unsigned char * | data | ) |
Definition at line 114 of file STexture.cpp.
bool STexture::ReloadFile | ( | const char * | path | ) |
Definition at line 109 of file STexture.cpp.
|
virtual |
Definition at line 193 of file STexture.cpp.
|
virtual |
Definition at line 188 of file STexture.cpp.
void STexture::SetType | ( | STexture::Type | type | ) |
Definition at line 248 of file STexture.cpp.
|
overridevirtual |
Used to get serialized values. All classes that inherit from VariableBinder will unconditionally call this function first during initialization.
name_str | Name of values |
value | Serialized values |
Implements CSE::VariableBinder.
Definition at line 273 of file STexture.cpp.
|
protected |
Definition at line 81 of file STexture.h.
|
protected |
Definition at line 80 of file STexture.h.
|
protected |
Definition at line 83 of file STexture.h.
|
protected |
Definition at line 79 of file STexture.h.
|
protected |
Definition at line 82 of file STexture.h.
|
protected |
Definition at line 77 of file STexture.h.
|
protected |
Definition at line 85 of file STexture.h.
|
protected |
Definition at line 76 of file STexture.h.
|
protected |
Definition at line 78 of file STexture.h.