ScummVM API documentation
OpenGL::TiledSurface Class Reference

#include <tiledsurface.h>

Public Member Functions

 TiledSurface (uint width, uint height, const Graphics::PixelFormat &pixelFormat)
 
void copyRectToSurface (const void *src, int srcPitch, int x, int y, int w, int h)
 
void update ()
 
void draw (SurfaceRenderer *surfaceRenderer) const
 
void fill (uint32 color)
 
Graphics::SurfacegetBackingSurface ()
 
const Graphics::SurfacegetBackingSurface () const
 
uint16 getWidth () const
 
uint16 getHeight () const
 

Detailed Description

Surface implementation using OpenGL texture tiles

Member Function Documentation

◆ copyRectToSurface()

void OpenGL::TiledSurface::copyRectToSurface ( const void *  src,
int  srcPitch,
int  x,
int  y,
int  w,
int  h 
)

Copy image data to the surface.

The format of the input data needs to match the format returned by getFormat. This does not immediately updates the textures.

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.

◆ update()

void OpenGL::TiledSurface::update ( )

Update the OpenGL textures from the backing surface

◆ draw()

void OpenGL::TiledSurface::draw ( SurfaceRenderer surfaceRenderer) const

Draw as a 2D surface

The destination rect is as follow : x: left [0.0, 1.0] right y: top [0.0, 1.0] bottom

Parameters
surfaceRenderer

◆ fill()

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

Fill the surface with a fixed color.

Parameters
colorColor value in format returned by getFormat.

◆ getBackingSurface() [1/2]

Graphics::Surface* OpenGL::TiledSurface::getBackingSurface ( )

Get the backing surface

This can be used to update the image data, but causes a full update. Using copyRectToSurface is preferred

◆ getBackingSurface() [2/2]

const Graphics::Surface* OpenGL::TiledSurface::getBackingSurface ( ) const

Get the backing surface

This const version can be used to read image data without causing a full texture invalidation.

◆ getWidth()

uint16 OpenGL::TiledSurface::getWidth ( void  ) const
inline

Get the dimensions in pixels of the surface

This does not include the unused area in the textures at the edges of the grid.


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