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" 35 #include "hpl1/opengl.h" 37 #ifdef HPL1_USE_OPENGL 41 class cSDLTexture :
public iTexture {
43 cSDLTexture(
const tString &asName,
Graphics::PixelFormat *apPxlFmt, iLowLevelGraphics *apLowLevelGraphics,
44 eTextureType aType,
bool abUseMipMaps, eTextureTarget aTarget,
45 bool abCompress =
false);
48 bool CreateFromBitmap(Bitmap2D *pBmp);
50 bool CreateAnimFromBitmapVec(tBitmap2DVec *avBitmaps);
52 bool CreateCubeFromBitmapVec(tBitmap2DVec *avBitmaps);
53 bool Create(
unsigned int alWidth,
unsigned int alHeight, cColor aCol);
55 bool CreateFromArray(
unsigned char *apPixelData,
int alChannels,
const cVector3l &avSize);
57 void SetPixels2D(
int alLevel,
const cVector2l &avOffset,
const cVector2l &avSize,
58 eColorDataFormat aDataFormat,
void *apPixelData);
60 float GetGamma() {
return 0; }
61 void SetGamma(
float afGamma) {}
62 int GetHandle() {
return (
int)mvTextureHandles[0]; }
64 void SetFilter(eTextureFilter aFilter);
65 void SetAnisotropyDegree(
float afX);
67 void SetWrapS(eTextureWrap aMode);
68 void SetWrapT(eTextureWrap aMode);
69 void SetWrapR(eTextureWrap aMode);
71 void Update(
float afTimeStep);
78 void SetTimeCount(
float afX);
79 int GetCurrentLowlevelHandle();
83 unsigned int GetTextureHandle();
87 bool CreateFromBitmapToHandle(Bitmap2D *pBmp,
int alHandleIdx);
89 GLenum InitCreation(
int alHandleIdx);
90 void PostCreation(GLenum aGLTarget);
92 GLenum GetGLWrap(eTextureWrap aMode);
94 tUIntVec mvTextureHandles;
96 cLowLevelGraphicsSDL *mpGfxSDL;
105 #endif // HPL1_USE_OPENGL 106 #endif // HPL_SDL_TEXTURE_H