ADTF_DISPLAY_TOOLBOX  3.8.0 (ADTF 3.14.3)
gltexture.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include <adtf_base.h>
13 
14 
15 namespace adtf
16 {
17 
18 namespace disptb
19 {
20 
21 namespace graphicslib
22 {
23 
24 namespace dengar
25 {
31 class cGLTexture : public ITexture
32 {
37 
38 protected:
39  tUInt m_hTexture;
44 
45 public:
46  cGLTexture();
47 
48  ~cGLTexture();
49 
56  tResult Create(const tBitmapFormat* psFormat, tInt nMode = 0);
57 
62  tResult CleanUp();
63 
64 public:
66  tResult Release();
67 
68  tVoid MakeCurrent();
69 
70  tResult SetMode(tInt nMode);
71 
72  tResult Copy(IImage* pImage);
73 
74  tInt GetWidth() const;
75 
76  tInt GetHeight() const;
77 
78  tInt GetBitsPerPixel() const;
79 
80  tInt GetPhysicalWidth() const;
81 
82  tInt GetPhysicalHeight() const;
84 
85 public:
91  tBool IsCompatible(const tBitmapFormat* psFormat);
92 
103  tVoid Blit(tInt x, tInt y, tInt nWidth, tInt nHeight);
104 
113  static tResult CalcOpenGLTextureFormat(const tBitmapFormat* pBitmapInfo,
114  GLenum* pPixelType,
115  GLenum* pBitmapFormat,
116  GLint* pBitmapFormatInternal);
117 
123  explicit operator ITexture*()
124  {
125  return static_cast<ITexture*>(this);
126  }
127 };
128 
129 }
130 
131 using dengar::cGLTexture;
132 
133 }
134 
135 }
136 
137 }
138 
Image and bitmap handling.
Definition: image_intf.h:29
The interface for common texture handling.
virtual tInt GetPhysicalWidth() const =0
Gets the physical width of the texture (in byte).
virtual tResult Release()=0
The Function releases the Texture.
virtual tVoid MakeCurrent()=0
Sets this texture as the current texture.
virtual tInt GetWidth() const =0
Gets the width of a texture (in pixel).
virtual tInt GetPhysicalHeight() const =0
Gets the physical height of the texture (in byte).
virtual tResult SetMode(tInt nMode)=0
Set the Mode shown in tTextureMode.
tTextureMode
The enumeration shows the texture modes.
virtual tResult Copy(IImage *pSource)=0
Fills the texture using a IImage.
virtual tInt GetBitsPerPixel() const =0
Gets the number of bits per line of a texture.
virtual tInt GetHeight() const =0
Gets the height of a texture (in pixel).
static tResult CalcOpenGLTextureFormat(const tBitmapFormat *pBitmapInfo, GLenum *pPixelType, GLenum *pBitmapFormat, GLint *pBitmapFormatInternal)
Calculates an OpenGL texture format based on a bitmap format.
tBool IsCompatible(const tBitmapFormat *psFormat)
tResult Create(const tBitmapFormat *psFormat, tInt nMode=0)
tVoid Blit(tInt x, tInt y, tInt nWidth, tInt nHeight)
Blits a texture to the given rectangle.
A_UTILS_D(cGLTexture)
D-Pointer implementation.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Main namespace.
Struct to specifie a bitmap.