22 #ifndef HPL_TEXTURE_TGL_H 23 #define HPL_TEXTURE_TGL_H 25 #include "hpl1/engine/graphics/Texture.h" 26 #include "hpl1/engine/graphics/bitmap2D.h" 27 #include "hpl1/engine/impl/low_level_graphics_tgl.h" 33 class TGLTexture :
public iTexture {
35 TGLTexture(
const tString &asName,
Graphics::PixelFormat *apPxlFmt, iLowLevelGraphics *apLowLevelGraphics,
36 eTextureType aType,
bool abUseMipMaps, eTextureTarget aTarget,
37 bool abCompress =
false);
40 bool CreateFromBitmap(Bitmap2D *pBmp);
42 bool CreateAnimFromBitmapVec(tBitmap2DVec *avBitmaps);
44 bool CreateCubeFromBitmapVec(tBitmap2DVec *avBitmaps);
45 bool Create(
unsigned int alWidth,
unsigned int alHeight, cColor aCol);
47 bool CreateFromArray(
unsigned char *apPixelData,
int alChannels,
const cVector3l &avSize);
49 void SetPixels2D(
int alLevel,
const cVector2l &avOffset,
const cVector2l &avSize,
50 eColorDataFormat aDataFormat,
void *apPixelData);
52 float GetGamma() {
return 0; }
53 void SetGamma(
float afGamma) {}
54 int GetHandle() {
return (
int)mvTextureHandles[0]; }
56 void SetFilter(eTextureFilter aFilter);
57 void SetAnisotropyDegree(
float afX);
59 void SetWrapS(eTextureWrap aMode);
60 void SetWrapT(eTextureWrap aMode);
61 void SetWrapR(eTextureWrap aMode);
63 void Update(
float afTimeStep);
70 void SetTimeCount(
float afX);
71 int GetCurrentLowlevelHandle();
75 unsigned int GetTextureHandle();
79 bool CreateFromBitmapToHandle(Bitmap2D *pBmp,
int alHandleIdx);
81 TGLenum InitCreation(
int alHandleIdx);
82 void PostCreation(TGLenum aGLTarget);
84 TGLenum GetGLWrap(eTextureWrap aMode);
86 tUIntVec mvTextureHandles;
88 LowLevelGraphicsTGL *mpGfxSDL;
99 #endif // HPL_TEXTURE_TGL_H