28 #ifndef HPL_SDL_TEXTURE_H 29 #define HPL_SDL_TEXTURE_H 31 #include "common/scummsys.h" 32 #include "hpl1/engine/graphics/Texture.h" 33 #include "hpl1/engine/graphics/bitmap2D.h" 34 #include "hpl1/engine/impl/LowLevelGraphicsSDL.h" 40 class cSDLTexture :
public iTexture {
42 cSDLTexture(
const tString &asName,
Graphics::PixelFormat *apPxlFmt, iLowLevelGraphics *apLowLevelGraphics,
43 eTextureType aType,
bool abUseMipMaps, eTextureTarget aTarget,
44 bool abCompress =
false);
47 bool CreateFromBitmap(Bitmap2D *pBmp);
49 bool CreateAnimFromBitmapVec(tBitmap2DVec *avBitmaps);
51 bool CreateCubeFromBitmapVec(tBitmap2DVec *avBitmaps);
52 bool Create(
unsigned int alWidth,
unsigned int alHeight, cColor aCol);
54 bool CreateFromArray(
unsigned char *apPixelData,
int alChannels,
const cVector3l &avSize);
56 void SetPixels2D(
int alLevel,
const cVector2l &avOffset,
const cVector2l &avSize,
57 eColorDataFormat aDataFormat,
void *apPixelData);
59 float GetGamma() {
return 0; }
60 void SetGamma(
float afGamma) {}
61 int GetHandle() {
return (
int)mvTextureHandles[0]; }
63 void SetFilter(eTextureFilter aFilter);
64 void SetAnisotropyDegree(
float afX);
66 void SetWrapS(eTextureWrap aMode);
67 void SetWrapT(eTextureWrap aMode);
68 void SetWrapR(eTextureWrap aMode);
70 void Update(
float afTimeStep);
77 void SetTimeCount(
float afX);
78 int GetCurrentLowlevelHandle();
82 unsigned int GetTextureHandle();
86 bool CreateFromBitmapToHandle(Bitmap2D *pBmp,
int alHandleIdx);
88 GLenum InitCreation(
int alHandleIdx);
89 void PostCreation(GLenum aGLTarget);
91 GLenum GetGLWrap(eTextureWrap aMode);
93 tUIntVec mvTextureHandles;
95 cLowLevelGraphicsSDL *mpGfxSDL;
105 #endif // HPL_SDL_TEXTURE_H