22 #ifndef BACKENDS_GRAPHICS3D_ANDROID_TEXTURE_H 23 #define BACKENDS_GRAPHICS3D_ANDROID_TEXTURE_H 25 #define GL_GLEXT_PROTOTYPES 28 #include "backends/graphics3d/opengl/framebuffer.h" 29 #include "graphics/surface.h" 30 #include "graphics/pixelformat.h" 32 #include "common/rect.h" 33 #include "common/array.h" 41 AndroidFrameBuffer(GLenum glIntFormat, GLenum glFormat, GLenum glType, GLuint texture_name, uint width, uint height, uint texture_width, uint texture_height);
48 static void unbindShader();
60 void setLinearFilter(
bool value);
62 virtual void allocBuffer(GLuint w, GLuint h);
64 virtual void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
65 const void *buf,
int pitch_buf) = 0;
66 virtual void fillBuffer(uint32 color) = 0;
68 void drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) {
69 drawTexture(x, y, w, h,
Common::Rect(0, 0, width(), height()));
71 void drawTexture(GLshort x, GLshort y, GLshort w, GLshort h,
const Common::Rect &clip);
77 inline void setDrawRect(int16 w, int16 h) {
81 inline void setDrawRect(int16 x1, int16 y1, int16 x2, int16 y2) {
89 inline void drawTextureRect() {
90 drawTexture(_draw_rect.left, _draw_rect.top,
91 _draw_rect.width(), _draw_rect.height());
94 inline void drawTextureOrigin() {
95 drawTexture(0, 0, _surface.w, _surface.h);
98 inline GLuint width()
const {
102 inline GLuint height()
const {
106 inline GLuint texWidth()
const {
107 return _texture_width;
110 inline GLuint texHeight()
const {
111 return _texture_height;
114 inline uint16 pitch()
const {
115 return _surface.pitch;
118 inline bool isEmpty()
const {
119 return _surface.w == 0 || _surface.h == 0;
131 virtual void setPalette(
const byte *colors, uint start, uint num) = 0;
132 virtual void setKeycolor(byte color) = 0;
133 virtual void grabPalette(byte *colors, uint start, uint num)
const = 0;
135 inline bool hasPalette()
const {
136 return _palettePixelFormat.bytesPerPixel > 0;
139 inline bool dirty()
const {
140 return _all_dirty || !_dirty_rect.isEmpty();
146 return _palettePixelFormat;
149 GLuint getTextureName()
const {
150 return _texture_name;
153 GLenum getTextureFormat()
const {
157 GLenum getTextureType()
const {
161 void setGameTexture() {
162 _is_game_texture =
true;
165 void setAlpha(
float alpha) {
172 virtual void *prepareTextureBuffer(
const Common::Rect &rect) = 0;
174 inline void setDirty() {
178 inline void clearDirty() {
181 _dirty_rect.left = 0;
182 _dirty_rect.bottom = 0;
183 _dirty_rect.right = 0;
188 if (_dirty_rect.isEmpty()) {
200 GLuint _texture_name;
202 GLuint _texture_width;
203 GLuint _texture_height;
213 bool _is_game_texture;
217 static bool _npot_supported;
219 static GLuint _verticesVBO;
231 void allocBuffer(GLuint w, GLuint h)
override;
233 void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
234 const void *buf,
int pitch_buf)
override;
235 void fillBuffer(uint32 color)
override;
237 void setPalette(
const byte *colors, uint start, uint num)
override {}
238 void setKeycolor(byte color)
override {};
239 void grabPalette(byte *colors, uint start, uint num)
const override {}
244 void *prepareTextureBuffer(
const Common::Rect &rect)
override;
289 #ifdef SCUMM_BIG_ENDIAN 303 #ifdef SCUMM_BIG_ENDIAN 319 void allocBuffer(GLuint w, GLuint h)
override;
320 void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
321 const void *buf,
int pitch_buf)
override;
322 void fillBuffer(uint32 color)
override;
340 void allocBuffer(GLuint w, GLuint h)
override;
342 void setPalette(
const byte *colors, uint start, uint num)
override;
343 void grabPalette(byte *colors, uint start, uint num)
const override;
346 void *prepareTextureBuffer(
const Common::Rect &rect)
override;
357 void setKeycolor(byte color)
override {};
365 void setKeycolor(byte color)
override;
376 void allocBuffer(GLuint w, GLuint h)
override;
378 void setPalette(
const byte *colors, uint start, uint num)
override;
379 void setKeycolor(byte color)
override {};
380 void grabPalette(byte *colors, uint start, uint num)
const override;
383 void *prepareTextureBuffer(
const Common::Rect &rect)
override;
394 void allocBuffer(GLuint w, GLuint h)
override;
396 void setPalette(
const byte *colors, uint start, uint num)
override;
397 void setKeycolor(byte color)
override;
398 void grabPalette(byte *colors, uint start, uint num)
const override;
401 void *prepareTextureBuffer(
const Common::Rect &rect)
override;
Definition: texture.h:223
Definition: texture.h:360
void extend(const Rect &r)
Definition: rect.h:278
Definition: texture.h:352
Definition: texture.h:389
Definition: texture.h:251
Definition: texture.h:333
Definition: texture.h:262
Definition: renderbuffer.h:27
Definition: texture.h:297
Definition: texture.h:273
Definition: texture.h:371
Definition: texture.h:311
Definition: texture.h:283