2012-10-12 01:55:55 +02:00
|
|
|
#ifndef _LC_TEXTURE_H_
|
|
|
|
#define _LC_TEXTURE_H_
|
|
|
|
|
|
|
|
#include "opengl.h"
|
|
|
|
|
2012-10-12 20:21:45 +02:00
|
|
|
#define LC_TEXTURE_WRAPU 0x01
|
|
|
|
#define LC_TEXTURE_WRAPV 0x02
|
|
|
|
#define LC_TEXTURE_MIPMAPS 0x04
|
2012-10-12 01:55:55 +02:00
|
|
|
|
|
|
|
class lcTexture
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
lcTexture();
|
|
|
|
~lcTexture();
|
|
|
|
|
|
|
|
bool Load();
|
2012-10-12 20:21:45 +02:00
|
|
|
bool Load(const char* FileName, int Flags = 0);
|
|
|
|
bool Load(lcFile& File, int Flags = 0);
|
2012-10-12 01:55:55 +02:00
|
|
|
void Unload();
|
|
|
|
|
|
|
|
int AddRef()
|
|
|
|
{
|
|
|
|
mRefCount++;
|
|
|
|
|
|
|
|
if (mRefCount == 1)
|
|
|
|
Load();
|
|
|
|
|
|
|
|
return mRefCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Release()
|
|
|
|
{
|
|
|
|
mRefCount--;
|
|
|
|
|
|
|
|
if (!mRefCount)
|
|
|
|
Unload();
|
|
|
|
|
|
|
|
return mRefCount;
|
|
|
|
}
|
|
|
|
|
2012-10-12 20:21:45 +02:00
|
|
|
int mWidth;
|
|
|
|
int mHeight;
|
2012-10-12 01:55:55 +02:00
|
|
|
char mName[LC_MAXPATH];
|
|
|
|
GLuint mTexture;
|
|
|
|
int mRefCount;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _LC_TEXTURE_H_
|