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"
33class 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 float GetGamma() {
return 0; }
50 void SetGamma(
float afGamma) {}
51 int GetHandle() {
return (
int)mvTextureHandles[0]; }
53 void SetFilter(eTextureFilter aFilter);
54 void SetAnisotropyDegree(
float afX);
56 void SetWrapS(eTextureWrap aMode);
57 void SetWrapT(eTextureWrap aMode);
58 void SetWrapR(eTextureWrap aMode);
60 void Update(
float afTimeStep);
67 void SetTimeCount(
float afX);
68 int GetCurrentLowlevelHandle();
72 unsigned int GetTextureHandle();
76 bool CreateFromBitmapToHandle(Bitmap2D *pBmp,
int alHandleIdx);
78 TGLenum InitCreation(
int alHandleIdx);
79 void PostCreation(TGLenum aGLTarget);
81 TGLenum GetGLWrap(eTextureWrap aMode);
83 tUIntVec mvTextureHandles;
85 LowLevelGraphicsTGL *mpGfxSDL;