ScummVM API documentation
OpenGL::Surface Class Referenceabstract

#include <texture.h>

Inheritance diagram for OpenGL::Surface:
OpenGL::Texture OpenGL::TextureCLUT8GPU OpenGL::FakeTexture OpenGL::TextureRGB555 OpenGL::TextureRGBA8888Swap

Public Member Functions

virtual void destroy ()=0
 
virtual void recreate ()=0
 
virtual void enableLinearFiltering (bool enable)=0
 
virtual void allocate (uint width, uint height)=0
 
virtual void setMask (const byte *mask)
 
void copyRectToTexture (uint x, uint y, uint w, uint h, const void *src, uint srcPitch)
 
void fill (uint32 color)
 
void fill (const Common::Rect &r, uint32 color)
 
void flagDirty ()
 
virtual bool isDirty () const
 
virtual uint getWidth () const =0
 
virtual uint getHeight () const =0
 
virtual Graphics::PixelFormat getFormat () const =0
 
virtual Graphics::SurfacegetSurface ()=0
 
virtual const Graphics::SurfacegetSurface () const =0
 
virtual bool hasPalette () const
 
virtual void setColorKey (uint colorKey)
 
virtual void setPalette (uint start, uint colors, const byte *palData)
 
virtual void setScaler (uint scalerIndex, int scaleFactor)
 
virtual void updateGLTexture ()=0
 
virtual const GLTexturegetGLTexture () const =0
 

Protected Member Functions

void clearDirty ()
 
void addDirtyArea (const Common::Rect &r)
 
Common::Rect getDirtyArea () const
 

Detailed Description

Interface for OpenGL implementations of a 2D surface.

Member Function Documentation

◆ destroy()

virtual void OpenGL::Surface::destroy ( )
pure virtual

Destroy OpenGL description of surface.

Implemented in OpenGL::TextureCLUT8GPU, and OpenGL::Texture.

◆ recreate()

virtual void OpenGL::Surface::recreate ( )
pure virtual

Recreate OpenGL description of surface.

Implemented in OpenGL::TextureCLUT8GPU, and OpenGL::Texture.

◆ enableLinearFiltering()

virtual void OpenGL::Surface::enableLinearFiltering ( bool  enable)
pure virtual

Enable or disable linear texture filtering.

Parameters
enabletrue to enable and false to disable.

Implemented in OpenGL::TextureCLUT8GPU, and OpenGL::Texture.

◆ allocate()

virtual void OpenGL::Surface::allocate ( uint  width,
uint  height 
)
pure virtual

Allocate storage for surface.

Parameters
widthThe desired logical width.
heightThe desired logical height.

Implemented in OpenGL::TextureCLUT8GPU, OpenGL::FakeTexture, and OpenGL::Texture.

◆ setMask()

virtual void OpenGL::Surface::setMask ( const byte *  mask)
inlinevirtual

Assign a mask to the surface, where a byte value of 0 is black with 0 alpha and 1 is the normal color.

Parameters
maskThe mask data.

Reimplemented in OpenGL::FakeTexture.

◆ copyRectToTexture()

void OpenGL::Surface::copyRectToTexture ( uint  x,
uint  y,
uint  w,
uint  h,
const void *  src,
uint  srcPitch 
)

Copy image data to the surface.

The format of the input data needs to match the format returned by getFormat.

Parameters
xX coordinate of upper left corner to copy data to.
yY coordinate of upper left corner to copy data to.
wWidth of the image data to copy.
hHeight of the image data to copy.
srcPointer to image data.
srcPitchThe number of bytes in a row of the image data.

◆ fill()

void OpenGL::Surface::fill ( uint32  color)

Fill the surface with a fixed color.

Parameters
colorColor value in format returned by getFormat.

◆ getFormat()

virtual Graphics::PixelFormat OpenGL::Surface::getFormat ( ) const
pure virtual
Returns
The logical format of the texture data.

Implemented in OpenGL::TextureCLUT8GPU, OpenGL::FakeTexture, and OpenGL::Texture.

◆ hasPalette()

virtual bool OpenGL::Surface::hasPalette ( ) const
inlinevirtual
Returns
Whether the surface is having a palette.

Reimplemented in OpenGL::TextureCLUT8GPU, and OpenGL::FakeTexture.

◆ setColorKey()

virtual void OpenGL::Surface::setColorKey ( uint  colorKey)
inlinevirtual

Set color key for paletted textures.

This needs to be called after any palette update affecting the color key. Calling this multiple times will result in multiple color indices to be treated as color keys.

Reimplemented in OpenGL::TextureCLUT8GPU, and OpenGL::FakeTexture.

◆ updateGLTexture()

virtual void OpenGL::Surface::updateGLTexture ( )
pure virtual

Update underlying OpenGL texture to reflect current state.

Implemented in OpenGL::TextureCLUT8GPU, OpenGL::TextureRGBA8888Swap, OpenGL::TextureRGB555, OpenGL::FakeTexture, and OpenGL::Texture.

◆ getGLTexture()

virtual const GLTexture& OpenGL::Surface::getGLTexture ( ) const
pure virtual

Obtain underlying OpenGL texture.

Implemented in OpenGL::TextureCLUT8GPU, and OpenGL::Texture.


The documentation for this class was generated from the following file: