|
ADTF Display Toolbox
|
OpenGL texture class. More...
#include <gltexture.h>
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... | |
OpenGL texture class.
Definition at line 84 of file gltexture.h.
|
inline |
Definition at line 94 of file gltexture.h.
|
inline |
Definition at line 102 of file gltexture.h.
|
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
| 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 |
Definition at line 521 of file gltexture.h.
References m_hTexture, m_nPhysicalHeight, m_nPhysicalWidth, m_sFormat, and ITexture::MakeCurrent().
|
inlinestatic |
Calculates an OpenGL texture format based on a bitmap format.
| [in] | pBitmapInfo | The input bitmap format. |
| [out] | pPixelType | The OpenGL pixel type. |
| [out] | pBitmapFormat | The OpenGL bitmap format. |
| [out] | pBitmapFormatInternal | The internal OpenGL bitmap format. |
Definition at line 572 of file gltexture.h.
References tBitmapFormat::nPixelFormat, IImage::PF_16BIT, IImage::PF_24BIT, IImage::PF_32BIT, IImage::PF_8BIT, IImage::PF_ABGR_1555, IImage::PF_ABGR_8888, IImage::PF_ARGB_1555, IImage::PF_ARGB_8888, IImage::PF_BGR_888, IImage::PF_BGRA_5551, IImage::PF_BGRA_8888, IImage::PF_BGRx_8888, IImage::PF_GREYSCALE_16, IImage::PF_GREYSCALE_24, IImage::PF_GREYSCALE_32, IImage::PF_GREYSCALE_8, IImage::PF_RGB_555, IImage::PF_RGB_565, IImage::PF_RGB_888, IImage::PF_RGBA_5551, IImage::PF_RGBA_8888, IImage::PF_RGBx_8888, IImage::PF_xBGR_8888, IImage::PF_xRGB_8888, and IImage::PF_YUV420P_888.
Referenced by Create().
|
inline |
Definition at line 186 of file gltexture.h.
References m_hTexture, and m_sFormat.
Referenced by Create().
|
inline |
| psFormat | [in] todo |
| nMode | [in] todo |
Definition at line 113 of file gltexture.h.
References CalcOpenGLTextureFormat(), CleanUp(), cImage::Create(), cImage::GetBitmap(), cImage::GetPixelFormatIdentifier(), m_hTexture, cImage::m_nDefaultLineAlignment, m_nMode, m_nPhysicalHeight, m_nPhysicalWidth, m_sFormat, ITexture::MODE_NearestPixel, tBitmapFormat::nHeight, and tBitmapFormat::nWidth.
|
inline |
| psFormat | [in] todo |
Definition at line 500 of file gltexture.h.
References m_sFormat, tBitmapFormat::nBitsPerPixel, tBitmapFormat::nHeight, tBitmapFormat::nPaletteSize, and tBitmapFormat::nWidth.
|
inlineexplicit |
|
protected |
Definition at line 87 of file gltexture.h.
|
protected |
Definition at line 91 of file gltexture.h.
Referenced by Create().
|
protected |
Definition at line 89 of file gltexture.h.
|
protected |
Definition at line 88 of file gltexture.h.
|
protected |
Definition at line 90 of file gltexture.h.
Referenced by Blit(), CleanUp(), Create(), and IsCompatible().