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;
150 void setAlpha(
float alpha) {
157 virtual void *prepareTextureBuffer(
const Common::Rect &rect) = 0;
159 inline void setDirty() {
163 inline void clearDirty() {
166 _dirty_rect.left = 0;
167 _dirty_rect.bottom = 0;
168 _dirty_rect.right = 0;
173 if (_dirty_rect.isEmpty()) {
185 GLuint _texture_name;
187 GLuint _texture_width;
188 GLuint _texture_height;
198 bool _is_game_texture;
202 static bool _npot_supported;
204 static GLuint _verticesVBO;
216 void allocBuffer(GLuint w, GLuint h)
override;
218 void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
219 const void *buf,
int pitch_buf)
override;
220 void fillBuffer(uint32 color)
override;
222 void setPalette(
const byte *colors, uint start, uint num)
override {}
223 void setKeycolor(byte color)
override {};
224 void grabPalette(byte *colors, uint start, uint num)
const override {}
229 void *prepareTextureBuffer(
const Common::Rect &rect)
override;
274 #ifdef SCUMM_BIG_ENDIAN 288 #ifdef SCUMM_BIG_ENDIAN 304 void allocBuffer(GLuint w, GLuint h)
override;
305 void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
306 const void *buf,
int pitch_buf)
override;
307 void fillBuffer(uint32 color)
override;
325 void allocBuffer(GLuint w, GLuint h)
override;
327 void setPalette(
const byte *colors, uint start, uint num)
override;
328 void grabPalette(byte *colors, uint start, uint num)
const override;
331 void *prepareTextureBuffer(
const Common::Rect &rect)
override;
342 void setKeycolor(byte color)
override {};
350 void setKeycolor(byte color)
override;
361 void allocBuffer(GLuint w, GLuint h)
override;
363 void setPalette(
const byte *colors, uint start, uint num)
override;
364 void setKeycolor(byte color)
override {};
365 void grabPalette(byte *colors, uint start, uint num)
const override;
368 void *prepareTextureBuffer(
const Common::Rect &rect)
override;
379 void allocBuffer(GLuint w, GLuint h)
override;
381 void setPalette(
const byte *colors, uint start, uint num)
override;
382 void setKeycolor(byte color)
override;
383 void grabPalette(byte *colors, uint start, uint num)
const override;
386 void *prepareTextureBuffer(
const Common::Rect &rect)
override;
Definition: texture.h:208
Definition: texture.h:345
void extend(const Rect &r)
Definition: rect.h:278
Definition: texture.h:337
Definition: texture.h:374
Definition: texture.h:236
Definition: texture.h:318
Definition: texture.h:247
Definition: renderbuffer.h:27
Definition: texture.h:282
Definition: texture.h:258
Definition: texture.h:356
Definition: texture.h:296
Definition: texture.h:268