summaryrefslogtreecommitdiff
path: root/common/texture.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/texture.h')
-rw-r--r--common/texture.h63
1 files changed, 31 insertions, 32 deletions
diff --git a/common/texture.h b/common/texture.h
index 546c7c8..52c223b 100644
--- a/common/texture.h
+++ b/common/texture.h
@@ -5,46 +5,45 @@
#ifndef _TEXTURE_H
#define _TEXTURE_H
-#ifndef GLuint
-#include <GL/gl.h>
-#endif
-
class File;
typedef enum { LC_INTENSITY, LC_RGB, LC_RGBA } LC_TEXTURE_TYPES;
class Texture
{
-public:
- Texture();
- ~Texture();
-
- void MakeCurrent()
- {
- if (m_nID != 0)
- { glBindTexture(GL_TEXTURE_2D, m_nID); }
- }
-
- bool IsLoaded()
- { return glIsTexture(m_nID) == GL_TRUE; }
- void Load(bool bFilter);
- bool LoadFromFile(char* strFilename, bool bFilter);
- void Unload();
-
- void LoadIndex(File* idx);
- void AddRef(bool bFilter);
- void DeRef();
-
- // Read-only
- char m_strName[9];
- unsigned short m_nWidth;
- unsigned short m_nHeight;
+ public:
+ Texture();
+ ~Texture();
+
+ void MakeCurrent()
+ {
+ if (m_nID != 0)
+ glBindTexture(GL_TEXTURE_2D, m_nID);
+ }
+
+ bool IsLoaded()
+ { return ((m_nID != 0) && (glIsTexture(m_nID) == GL_TRUE)); }
+ void Load(bool bFilter);
+ bool LoadFromFile(char* strFilename, bool bFilter);
+ void Unload();
+
+ void LoadIndex(File* idx);
+ void AddRef(bool bFilter);
+ void DeRef();
+
+ // Read-only
+ char m_strName[9];
+ unsigned short m_nWidth;
+ unsigned short m_nHeight;
protected:
- int m_nRef;
- GLuint m_nID;
- GLenum m_nType;
- unsigned long m_nOffset;
+ bool FinishLoadImage (bool bFilter, void *data);
+
+ int m_nRef;
+ GLuint m_nID;
+ GLenum m_nFormat;
+ unsigned long m_nOffset;
+ unsigned long m_nFileSize;
};