ScummVM API documentation
OpenGL::GLTexture Class Reference

#include <texture.h>

Public Member Functions

 GLTexture (GLenum glIntFormat, GLenum glFormat, GLenum glType)
 
void enableLinearFiltering (bool enable)
 
bool isLinearFilteringEnabled () const
 
void setWrapMode (WrapMode wrapMode)
 
void destroy ()
 
void create ()
 
void bind () const
 
bool setSize (uint width, uint height)
 
void updateArea (const Common::Rect &area, const Graphics::Surface &src)
 
uint getWidth () const
 
uint getHeight () const
 
uint getLogicalWidth () const
 
uint getLogicalHeight () const
 
const GLfloat * getTexCoords () const
 
GLuint getGLTexture () const
 

Detailed Description

A simple GL texture object abstraction.

This is used for low-level GL texture handling.

Constructor & Destructor Documentation

◆ GLTexture()

OpenGL::GLTexture::GLTexture ( GLenum  glIntFormat,
GLenum  glFormat,
GLenum  glType 
)

Constrcut a new GL texture object.

Parameters
glIntFormatThe internal format to use.
glFormatThe input format.
glTypeThe input type.

Member Function Documentation

◆ enableLinearFiltering()

void OpenGL::GLTexture::enableLinearFiltering ( bool  enable)

Enable or disable linear texture filtering.

Parameters
enabletrue to enable and false to disable.

◆ isLinearFilteringEnabled()

bool OpenGL::GLTexture::isLinearFilteringEnabled ( ) const
inline

Test whether linear filtering is enabled.

◆ setWrapMode()

void OpenGL::GLTexture::setWrapMode ( WrapMode  wrapMode)

Enable or disable linear texture filtering.

Parameters
enabletrue to enable and false to disable.

◆ destroy()

void OpenGL::GLTexture::destroy ( )

Destroy the OpenGL texture name.

◆ create()

void OpenGL::GLTexture::create ( )

Create the OpenGL texture name.

◆ bind()

void OpenGL::GLTexture::bind ( ) const

Bind the texture to the active texture unit.

◆ setSize()

bool OpenGL::GLTexture::setSize ( uint  width,
uint  height 
)

Sets the size of the texture in pixels.

The internal OpenGL texture might have a different size. To query the actual size use getWidth()/getHeight().

Parameters
widthThe desired logical width.
heightThe desired logical height.
Returns
Whether the call was successful

◆ updateArea()

void OpenGL::GLTexture::updateArea ( const Common::Rect area,
const Graphics::Surface src 
)

Copy image data to the texture.

Parameters
areaThe area to update.
srcSurface for the whole texture containing the pixel data to upload. Only the area described by area will be uploaded.

◆ getWidth()

uint OpenGL::GLTexture::getWidth ( void  ) const
inline

Query the GL texture's width.

◆ getHeight()

uint OpenGL::GLTexture::getHeight ( void  ) const
inline

Query the GL texture's height.

◆ getLogicalWidth()

uint OpenGL::GLTexture::getLogicalWidth ( ) const
inline

Query the logical texture's width.

◆ getLogicalHeight()

uint OpenGL::GLTexture::getLogicalHeight ( ) const
inline

Query the logical texture's height.

◆ getTexCoords()

const GLfloat* OpenGL::GLTexture::getTexCoords ( ) const
inline

Obtain texture coordinates for rectangular drawing.

◆ getGLTexture()

GLuint OpenGL::GLTexture::getGLTexture ( ) const
inline

Obtain texture name.

Beware that the texture name changes whenever create is used. destroy will invalidate the texture name.


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