mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 12:10:41 +00:00
51 lines
1.3 KiB
C++
51 lines
1.3 KiB
C++
|
|
#ifndef __GLTEXTURE_H
|
|
#define __GLTEXTURE_H
|
|
|
|
class FBitmap;
|
|
class FTexture;
|
|
|
|
#include "tarray.h"
|
|
|
|
class FHardwareTexture //: public IHardwareTexture
|
|
{
|
|
public:
|
|
enum
|
|
{
|
|
Indexed,
|
|
TrueColor,
|
|
HighColor, // 16 bit - Can be used to save space in memory constrained scenarios at the cost of visual accuracy.
|
|
Brightmap, // This can be stored as RGBA2 to save space, it also doesn't really need a mipmap.
|
|
};
|
|
|
|
private:
|
|
|
|
int mSampler = 0;
|
|
unsigned int glTexID = 0;
|
|
int internalType = TrueColor;
|
|
bool mipmapped = true;
|
|
int mWidth = 0, mHeight = 0;
|
|
int colorId = 0;
|
|
uint32_t allocated = 0;
|
|
|
|
public:
|
|
|
|
~FHardwareTexture();
|
|
|
|
//bool BindOrCreate(FTexture *tex, int texunit, int clampmode, int translation, int flags);
|
|
|
|
unsigned int CreateTexture(int w, int h, bool type, bool mipmapped) = delete;
|
|
unsigned int CreateTexture(int w, int h, int type, bool mipmapped);
|
|
unsigned int LoadTexture(const unsigned char * buffer);
|
|
unsigned int LoadTexturePart(const unsigned char* buffer, int x, int y, int w, int h);
|
|
unsigned int LoadTexture(FBitmap &bmp);
|
|
unsigned int GetTextureHandle();
|
|
int GetSampler() { return mSampler; }
|
|
void SetSampler(int sampler) { mSampler = sampler; }
|
|
bool isIndexed() const { return internalType == Indexed; }
|
|
|
|
friend class FGameTexture;
|
|
};
|
|
|
|
|
|
#endif
|