22 #ifndef BACKENDS_GRAPHICS3D_ANDROID_TEXTURE_H 23 #define BACKENDS_GRAPHICS3D_ANDROID_TEXTURE_H 25 #define GL_GLEXT_PROTOTYPES 28 #include "graphics/surface.h" 29 #include "graphics/pixelformat.h" 31 #include "common/rect.h" 32 #include "common/array.h" 41 static void unbindShader();
53 void setLinearFilter(
bool value);
55 virtual void allocBuffer(GLuint w, GLuint h);
57 virtual void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
58 const void *buf,
int pitch_buf) = 0;
59 virtual void fillBuffer(uint32 color) = 0;
61 void drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) {
62 drawTexture(x, y, w, h,
Common::Rect(0, 0, width(), height()));
64 void drawTexture(GLshort x, GLshort y, GLshort w, GLshort h,
const Common::Rect &clip);
70 inline void setDrawRect(int16 w, int16 h) {
74 inline void setDrawRect(int16 x1, int16 y1, int16 x2, int16 y2) {
82 inline void drawTextureRect() {
83 drawTexture(_draw_rect.left, _draw_rect.top,
84 _draw_rect.width(), _draw_rect.height());
87 inline void drawTextureOrigin() {
88 drawTexture(0, 0, _surface.w, _surface.h);
91 inline GLuint width()
const {
95 inline GLuint height()
const {
99 inline GLuint texWidth()
const {
100 return _texture_width;
103 inline GLuint texHeight()
const {
104 return _texture_height;
107 inline uint16 pitch()
const {
108 return _surface.pitch;
111 inline bool isEmpty()
const {
112 return _surface.w == 0 || _surface.h == 0;
124 virtual void setPalette(
const byte *colors, uint start, uint num) = 0;
125 virtual void setKeycolor(byte color) = 0;
126 virtual void grabPalette(byte *colors, uint start, uint num)
const = 0;
128 inline bool hasPalette()
const {
129 return _palettePixelFormat.bytesPerPixel > 0;
132 inline bool dirty()
const {
133 return _all_dirty || !_dirty_rect.isEmpty();
139 return _palettePixelFormat;
142 GLuint getTextureName()
const {
143 return _texture_name;
146 void setGameTexture() {
147 _is_game_texture =
true;
153 virtual void *prepareTextureBuffer(
const Common::Rect &rect) = 0;
155 inline void setDirty() {
159 inline void clearDirty() {
162 _dirty_rect.left = 0;
163 _dirty_rect.bottom = 0;
164 _dirty_rect.right = 0;
169 if (_dirty_rect.isEmpty()) {
181 GLuint _texture_name;
183 GLuint _texture_width;
184 GLuint _texture_height;
194 bool _is_game_texture;
196 static bool _npot_supported;
198 static GLuint _verticesVBO;
210 void allocBuffer(GLuint w, GLuint h)
override;
212 void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
213 const void *buf,
int pitch_buf)
override;
214 void fillBuffer(uint32 color)
override;
216 void setPalette(
const byte *colors, uint start, uint num)
override {}
217 void setKeycolor(byte color)
override {};
218 void grabPalette(byte *colors, uint start, uint num)
const override {}
223 void *prepareTextureBuffer(
const Common::Rect &rect)
override;
268 #ifdef SCUMM_BIG_ENDIAN 282 #ifdef SCUMM_BIG_ENDIAN 298 void allocBuffer(GLuint w, GLuint h)
override;
299 void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
300 const void *buf,
int pitch_buf)
override;
301 void fillBuffer(uint32 color)
override;
319 void allocBuffer(GLuint w, GLuint h)
override;
321 void setPalette(
const byte *colors, uint start, uint num)
override;
322 void grabPalette(byte *colors, uint start, uint num)
const override;
325 void *prepareTextureBuffer(
const Common::Rect &rect)
override;
336 void setKeycolor(byte color)
override {};
344 void setKeycolor(byte color)
override;
355 void allocBuffer(GLuint w, GLuint h)
override;
357 void setPalette(
const byte *colors, uint start, uint num)
override;
358 void setKeycolor(byte color)
override {};
359 void grabPalette(byte *colors, uint start, uint num)
const override;
362 void *prepareTextureBuffer(
const Common::Rect &rect)
override;
373 void allocBuffer(GLuint w, GLuint h)
override;
375 void setPalette(
const byte *colors, uint start, uint num)
override;
376 void setKeycolor(byte color)
override;
377 void grabPalette(byte *colors, uint start, uint num)
const override;
380 void *prepareTextureBuffer(
const Common::Rect &rect)
override;
Definition: texture.h:202
Definition: texture.h:339
void extend(const Rect &r)
Definition: rect.h:278
Definition: texture.h:331
Definition: texture.h:368
Definition: texture.h:230
Definition: texture.h:312
Definition: texture.h:241
Definition: renderbuffer.h:27
Definition: texture.h:276
Definition: texture.h:252
Definition: texture.h:350
Definition: texture.h:290
Definition: texture.h:262