22 #ifndef BACKENDS_GRAPHICS_OPENGL_TEXTURE_H 23 #define BACKENDS_GRAPHICS_OPENGL_TEXTURE_H 25 #include "graphics/opengl/system_headers.h" 26 #include "graphics/opengl/context.h" 27 #include "graphics/opengl/texture.h" 29 #include "graphics/pixelformat.h" 30 #include "graphics/surface.h" 32 #include "common/rect.h" 69 virtual void allocate(uint width, uint height) = 0;
91 void copyRectToTexture(uint x, uint y, uint w, uint h,
const void *src, uint srcPitch);
98 void fill(uint32 color);
101 void flagDirty() { _allDirty =
true; }
102 virtual bool isDirty()
const {
return _allDirty || !_dirtyArea.
isEmpty(); }
104 virtual uint getWidth()
const = 0;
105 virtual uint getHeight()
const = 0;
128 virtual void setPalette(uint start, uint colors,
const byte *palData) {}
130 virtual void setScaler(uint scalerIndex,
int scaleFactor) {}
142 void clearDirty() { _allDirty =
false; _dirtyArea =
Common::Rect(); }
174 void allocate(uint width, uint height)
override;
176 uint getWidth()
const override {
return _userPixelData.w; }
177 uint getHeight()
const override {
return _userPixelData.h; }
206 void allocate(uint width, uint height)
override;
207 void setMask(
const byte *mask)
override;
211 bool hasPalette()
const override {
return (_palette !=
nullptr); }
214 void setPalette(uint start, uint colors,
const byte *palData)
override;
249 ~ScaledTextureSurface()
override;
251 void allocate(uint width, uint height)
override;
253 uint getWidth()
const override {
return _rgbData.w; }
254 uint getHeight()
const override {
return _rgbData.h; }
257 bool hasPalette()
const override {
return (_palette !=
nullptr); }
264 void setScaler(uint scalerIndex,
int scaleFactor)
override;
289 void allocate(uint width, uint height)
override;
291 bool isDirty()
const override {
return _paletteDirty || Surface::isDirty(); }
293 uint getWidth()
const override {
return _userPixelData.w; }
294 uint getHeight()
const override {
return _userPixelData.h; }
301 void setPalette(uint start, uint colors,
const byte *palData)
override;
309 static bool isSupportedByContext() {
310 return OpenGLContext.shadersSupported
311 && OpenGLContext.multitextureSupported
312 && OpenGLContext.framebufferObjectSupported;
323 GLfloat _clut8Vertices[4*2];
328 byte _palette[4 * 256];
331 #endif // !USE_FORCED_GLES
virtual void setColorKey(uint colorKey)
Definition: texture.h:127
Definition: texture.h:201
virtual bool hasPalette() const
Definition: texture.h:118
const Texture & getGLTexture() const override
Definition: texture.h:188
Graphics::PixelFormat getFormat() const override
Definition: texture.h:209
virtual void recreate()=0
virtual void setMask(const byte *mask)
Definition: texture.h:76
Graphics::PixelFormat getFormat() const override
Definition: texture.h:182
bool hasPalette() const override
Definition: texture.h:298
bool hasPalette() const override
Definition: texture.h:211
virtual void allocate(uint width, uint height)=0
void copyRectToTexture(uint x, uint y, uint w, uint h, const void *src, uint srcPitch)
Definition: framebuffer.h:203
virtual void enableLinearFiltering(bool enable)=0
Definition: renderbuffer.h:27
virtual void updateGLTexture()=0
Definition: texture.h:229
virtual Graphics::PixelFormat getFormat() const =0
Definition: texture.h:155
Definition: texture.h:278
Definition: scalerplugin.h:28
Definition: texture.h:237
virtual const Texture & getGLTexture() const =0
bool isEmpty() const
Definition: rect.h:330