ADTF Display Toolbox
gltexture.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include <adtf_base.h>
11 
12 namespace adtf
13 {
14 
15 namespace disptb
16 {
17 
18 namespace graphicslib
19 {
20 
21 namespace dengar
22 {
23 
24 typedef uint32_t GLenum;
25 typedef int32_t GLint;
26 
32 class cGLTexture : public ITexture
33 {
37  A_UTILS_D(cGLTexture)
38 
39 protected:
40  tUInt m_hTexture;
45 
46 public:
47  cGLTexture();
48 
49  ~cGLTexture();
50 
57  tResult Create(const tBitmapFormat* psFormat, tInt nMode = 0);
58 
63  tResult CleanUp();
64 
65 public:
67  tResult Release();
68 
69  tVoid MakeCurrent();
70 
71  tResult SetMode(tInt nMode);
72 
73  tResult Copy(IImage* pImage);
74 
75  tInt GetWidth() const;
76 
77  tInt GetHeight() const;
78 
79  tInt GetBitsPerPixel() const;
80 
81  tInt GetPixelFormat() const;
82 
83  tInt GetStride() const;
84 
85  tInt GetPhysicalWidth() const;
86 
87  tInt GetPhysicalHeight() const;
89 
90 public:
96  tBool IsCompatible(const tBitmapFormat* psFormat);
97 
108  tVoid Blit(tInt x, tInt y, tInt nWidth, tInt nHeight);
109 
118  static tResult CalcOpenGLTextureFormat(const tBitmapFormat* pBitmapInfo,
119  GLenum* pPixelType,
120  GLenum* pBitmapFormat,
121  GLint* pBitmapFormatInternal);
122 
128  explicit operator ITexture*()
129  {
130  return static_cast<ITexture*>(this);
131  }
132 };
133 
134 }
135 
136 using dengar::cGLTexture;
137 
138 }
139 
140 }
141 
142 }
143 
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.
tUInt m_hTexture
D-Pointer implementation.
Definition: gltexture.h:40
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.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Main namespace.
Struct to specifie a bitmap.