ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Surface implementation using OpenGL texture tiles. More...

#include <tiledsurface.h>

Collaboration diagram for OpenGL::TiledSurface:

List of all members.

Classes

struct  Tile

Public Member Functions

 TiledSurface (uint width, uint height, const Graphics::PixelFormat &pixelFormat)
 ~TiledSurface ()
void copyRectToSurface (const void *src, int srcPitch, int x, int y, int w, int h)
 Copy image data to the surface.
void update ()
 Update the OpenGL textures from the backing surface.
void draw (SurfaceRenderer *surfaceRenderer) const
 Draw as a 2D surface.
void fill (uint32 color)
 Fill the surface with a fixed color.
Graphics::SurfacegetBackingSurface ()
 Get the backing surface.
const Graphics::SurfacegetBackingSurface () const
 Get the backing surface.
uint16 getWidth () const
 Get the dimensions in pixels of the surface.
uint16 getHeight () const

Private Member Functions

void invalidateAllTiles ()

Private Attributes

Graphics::Surface _backingSurface
Common::Array< Tile_tiles

Static Private Attributes

static const uint maxTextureSize = 256

Detailed Description

Surface implementation using OpenGL texture tiles.

Definition at line 41 of file tiledsurface.h.


Constructor & Destructor Documentation

OpenGL::TiledSurface::TiledSurface ( uint  width,
uint  height,
const Graphics::PixelFormat pixelFormat 
)
OpenGL::TiledSurface::~TiledSurface (  ) 

Member Function Documentation

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:
x X coordinate of upper left corner to copy data to.
y Y coordinate of upper left corner to copy data to.
w Width of the image data to copy.
h Height of the image data to copy.
src Pointer to image data.
srcPitch The number of bytes in a row of the image data.
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 
void OpenGL::TiledSurface::fill ( uint32  color  ) 

Fill the surface with a fixed color.

Parameters:
color Color value in format returned by getFormat.
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

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.

uint16 OpenGL::TiledSurface::getHeight (  )  const [inline]

Definition at line 108 of file tiledsurface.h.

uint16 OpenGL::TiledSurface::getWidth (  )  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.

Definition at line 107 of file tiledsurface.h.

void OpenGL::TiledSurface::invalidateAllTiles (  )  [private]
void OpenGL::TiledSurface::update (  ) 

Update the OpenGL textures from the backing surface.


Member Data Documentation

Definition at line 120 of file tiledsurface.h.

const uint OpenGL::TiledSurface::maxTextureSize = 256 [static, private]

Definition at line 111 of file tiledsurface.h.


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


Generated on Sat May 18 2019 05:07:06 for ResidualVM by doxygen 1.7.1
curved edge   curved edge