ScummVM API documentation
OpenGL::Texture Class Reference

#include <texture.h>

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

Public Member Functions

 Texture (GLenum glIntFormat, GLenum glFormat, GLenum glType, const Graphics::PixelFormat &format)
 
void destroy () override
 
void recreate () override
 
void enableLinearFiltering (bool enable) override
 
void allocate (uint width, uint height) override
 
uint getWidth () const override
 
uint getHeight () const override
 
Graphics::PixelFormat getFormat () const override
 
Graphics::SurfacegetSurface () override
 
const Graphics::SurfacegetSurface () const override
 
void updateGLTexture () override
 
const GLTexturegetGLTexture () const override
 
- Public Member Functions inherited from OpenGL::Surface
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 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)
 

Protected Member Functions

void updateGLTexture (Common::Rect &dirtyArea)
 
- Protected Member Functions inherited from OpenGL::Surface
void clearDirty ()
 
void addDirtyArea (const Common::Rect &r)
 
Common::Rect getDirtyArea () const
 

Protected Attributes

const Graphics::PixelFormat _format
 

Detailed Description

An OpenGL texture wrapper. It automatically takes care of all OpenGL texture handling issues and also provides access to the texture data.

Constructor & Destructor Documentation

◆ Texture()

OpenGL::Texture::Texture ( GLenum  glIntFormat,
GLenum  glFormat,
GLenum  glType,
const Graphics::PixelFormat format 
)

Create a new texture with the specific internal format.

Parameters
glIntFormatThe internal format to use.
glFormatThe input format.
glTypeThe input type.
formatThe format used for the texture input.

Member Function Documentation

◆ destroy()

void OpenGL::Texture::destroy ( )
overridevirtual

Destroy OpenGL description of surface.

Implements OpenGL::Surface.

◆ recreate()

void OpenGL::Texture::recreate ( )
overridevirtual

Recreate OpenGL description of surface.

Implements OpenGL::Surface.

◆ enableLinearFiltering()

void OpenGL::Texture::enableLinearFiltering ( bool  enable)
overridevirtual

Enable or disable linear texture filtering.

Parameters
enabletrue to enable and false to disable.

Implements OpenGL::Surface.

◆ allocate()

void OpenGL::Texture::allocate ( uint  width,
uint  height 
)
overridevirtual

Allocate storage for surface.

Parameters
widthThe desired logical width.
heightThe desired logical height.

Implements OpenGL::Surface.

Reimplemented in OpenGL::FakeTexture.

◆ getFormat()

Graphics::PixelFormat OpenGL::Texture::getFormat ( ) const
inlineoverridevirtual
Returns
The logical format of the texture data.

Implements OpenGL::Surface.

Reimplemented in OpenGL::FakeTexture.

◆ updateGLTexture()

void OpenGL::Texture::updateGLTexture ( )
overridevirtual

Update underlying OpenGL texture to reflect current state.

Implements OpenGL::Surface.

Reimplemented in OpenGL::TextureRGBA8888Swap, OpenGL::TextureRGB555, and OpenGL::FakeTexture.

◆ getGLTexture()

const GLTexture& OpenGL::Texture::getGLTexture ( ) const
inlineoverridevirtual

Obtain underlying OpenGL texture.

Implements OpenGL::Surface.


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