ADTF_DISPLAY_TOOLBOX  3.8.0 (ADTF 3.14.3)
cGLTexture

OpenGL texture class. More...

Inheritance diagram for cGLTexture:
[legend]

Public Member Functions

tResult Create (const tBitmapFormat *psFormat, tInt nMode=0)
 
tResult CleanUp ()
 
tBool IsCompatible (const tBitmapFormat *psFormat)
 
tVoid Blit (tInt x, tInt y, tInt nWidth, tInt nHeight)
 Blits a texture to the given rectangle. More...
 
 operator ITexture * ()
 instance of ITexture More...
 
- Public Member Functions inherited from ITexture
virtual ~ITexture ()
 virtual destructor to ensure proper cleanup.
 
virtual tResult Release ()=0
 The Function releases the Texture. More...
 
virtual tResult SetMode (tInt nMode)=0
 Set the Mode shown in tTextureMode. More...
 
virtual tVoid MakeCurrent ()=0
 Sets this texture as the current texture.
 
virtual tResult Copy (IImage *pSource)=0
 Fills the texture using a IImage. More...
 
virtual tInt GetWidth () const =0
 Gets the width of a texture (in pixel). More...
 
virtual tInt GetHeight () const =0
 Gets the height of a texture (in pixel). More...
 
virtual tInt GetBitsPerPixel () const =0
 Gets the number of bits per line of a texture. More...
 
virtual tInt GetPhysicalWidth () const =0
 Gets the physical width of the texture (in byte). More...
 
virtual tInt GetPhysicalHeight () const =0
 Gets the physical height of the texture (in byte). More...
 

Static Public Member Functions

static tResult CalcOpenGLTextureFormat (const tBitmapFormat *pBitmapInfo, GLenum *pPixelType, GLenum *pBitmapFormat, GLint *pBitmapFormatInternal)
 Calculates an OpenGL texture format based on a bitmap format. More...
 

Protected Attributes

tUInt m_hTexture
 
tInt m_nPhysicalWidth
 
tInt m_nPhysicalHeight
 
tBitmapFormat m_sFormat
 
ITexture::tTextureMode m_nMode
 

Private Member Functions

 A_UTILS_D (cGLTexture)
 D-Pointer implementation.
 

Additional Inherited Members

- Public Types inherited from ITexture
enum  tTextureMode { MODE_BilinearFiltered , MODE_NearestPixel }
 The enumeration shows the texture modes. More...
 

Detailed Description

OpenGL texture class.

Definition at line 31 of file gltexture.h.

Member Function Documentation

◆ Blit()

tVoid Blit ( tInt  x,
tInt  y,
tInt  nWidth,
tInt  nHeight 
)

Blits a texture to the given rectangle.

The whole texture will be placed into that rectangle. Colorizing the texture by using ICanvas::Color() is not possible, because the color is set to white and the previous color is restored after blitting

Parameters
x[in] starting position inside canvas
y[in] starting position inside canvas
nWidth[in] width of the destination rectangle which receives the texture
nHeight[in] height of the destination rectangle which receives the texture
Returns
tVoid

◆ CalcOpenGLTextureFormat()

static tResult CalcOpenGLTextureFormat ( const tBitmapFormat pBitmapInfo,
GLenum *  pPixelType,
GLenum *  pBitmapFormat,
GLint *  pBitmapFormatInternal 
)
static

Calculates an OpenGL texture format based on a bitmap format.

Parameters
[in]pBitmapInfoThe input bitmap format.
[out]pPixelTypeThe OpenGL pixel type.
[out]pBitmapFormatThe OpenGL bitmap format.
[out]pBitmapFormatInternalThe internal OpenGL bitmap format.
Returns
The standard result code.

◆ CleanUp()

tResult CleanUp ( )
Returns
The standard result code.

◆ Create()

tResult Create ( const tBitmapFormat psFormat,
tInt  nMode = 0 
)
Parameters
psFormat[in] todo
nMode[in] todo
Returns
The standard result code.

◆ IsCompatible()

tBool IsCompatible ( const tBitmapFormat psFormat)
Parameters
psFormat[in] todo
Returns
todo

◆ operator ITexture *()

operator ITexture * ( )
inlineexplicit

instance of ITexture

Returns
object

Definition at line 123 of file gltexture.h.

Member Data Documentation

◆ m_hTexture

tUInt m_hTexture
protected

Definition at line 39 of file gltexture.h.

◆ m_nMode

ITexture::tTextureMode m_nMode
protected

Definition at line 43 of file gltexture.h.

◆ m_nPhysicalHeight

tInt m_nPhysicalHeight
protected

Definition at line 41 of file gltexture.h.

◆ m_nPhysicalWidth

tInt m_nPhysicalWidth
protected

Definition at line 40 of file gltexture.h.

◆ m_sFormat

tBitmapFormat m_sFormat
protected

Definition at line 42 of file gltexture.h.