17 TEX_2D = 0, TEX_CUBE = 1
25 bool LoadFile(
const char* path);
27 bool LoadFromMemory(
const unsigned char* rawData,
int length);
29 virtual bool Load(
unsigned char* data);
31 bool ReloadFile(
const char* path);
33 bool Reload(
unsigned char* data);
35 unsigned int GetTextureID()
const {
39 virtual bool InitTexture(
int width,
int height,
int channel = GL_RGB,
int internalFormat = GL_RGB8,
40 int glType = GL_UNSIGNED_BYTE);
42 bool InitTextureMipmap(
int width,
int height,
int channel = GL_RGB,
int internalFormat = GL_RGB8,
43 int glType = GL_UNSIGNED_BYTE);
45 virtual void SetParameteri(
int targetName,
int value)
const;
47 virtual void SetParameterfv(
int targetName,
float* value)
const;
51 void Exterminate()
override;
53 virtual void Bind(GLint location,
int layout);
55 static void BindEmpty(GLint location,
int layout, STexture::Type type = TEX_2D);
57 void GenerateMipmap()
const;
61 void SetType(Type type);
63 int getMWidth()
const;
65 int getMHeight()
const;
71 static void LoadEmpty();
73 static int GetTypeToTargetGL(STexture::Type type);
77 int m_targetGL = GL_TEXTURE_2D;
81 int m_internalFormat = 0;
82 int m_glType = GL_UNSIGNED_BYTE;
84 unsigned int m_texId = 0;
87 static unsigned int m_emptyTextureId;