ADTF Display Toolbox
Loading...
Searching...
No Matches
cGLTexture

OpenGL texture class. More...

#include <gltexture.h>

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.
 
 operator ITexture * ()
 instance of ITexture
 
- Public Member Functions inherited from ITexture
virtual ~ITexture ()
 virtual destructor to ensure proper cleanup.
 
virtual tResult Release ()=0
 The Function releases the Texture.
 
virtual tResult SetMode (tInt nMode)=0
 Set the Mode shown in tTextureMode.
 
virtual tVoid MakeCurrent ()=0
 Sets this texture as the current texture.
 
virtual tResult Copy (IImage *pSource)=0
 Fills the texture using a IImage.
 
virtual tInt GetWidth () const =0
 Gets the width of a texture (in pixel).
 
virtual tInt GetHeight () const =0
 Gets the height of a texture (in pixel).
 
virtual tInt GetBitsPerPixel () const =0
 Gets the number of bits per line of a texture.
 
virtual tInt GetPhysicalWidth () const =0
 Gets the physical width of the texture (in byte).
 
virtual tInt GetPhysicalHeight () const =0
 Gets the physical height of the texture (in byte).
 

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.
 

Protected Attributes

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

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 84 of file gltexture.h.

Constructor & Destructor Documentation

◆ cGLTexture()

cGLTexture ( )
inline

Definition at line 94 of file gltexture.h.

◆ ~cGLTexture()

~cGLTexture ( )
inline

Definition at line 102 of file gltexture.h.

Member Function Documentation

◆ Blit()

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

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

Definition at line 521 of file gltexture.h.

◆ CalcOpenGLTextureFormat()

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

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.

Definition at line 572 of file gltexture.h.

◆ CleanUp()

tResult CleanUp ( )
inline
Returns
The standard result code.

Definition at line 186 of file gltexture.h.

◆ Create()

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

Definition at line 113 of file gltexture.h.

◆ IsCompatible()

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

Definition at line 500 of file gltexture.h.

◆ operator ITexture *()

operator ITexture * ( )
inlineexplicit

instance of ITexture

Returns
object

Definition at line 798 of file gltexture.h.

Member Data Documentation

◆ m_hTexture

tUInt m_hTexture
protected

Definition at line 87 of file gltexture.h.

◆ m_nMode

ITexture::tTextureMode m_nMode
protected

Definition at line 91 of file gltexture.h.

◆ m_nPhysicalHeight

tInt m_nPhysicalHeight
protected

Definition at line 89 of file gltexture.h.

◆ m_nPhysicalWidth

tInt m_nPhysicalWidth
protected

Definition at line 88 of file gltexture.h.

◆ m_sFormat

tBitmapFormat m_sFormat
protected

Definition at line 90 of file gltexture.h.