#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 |
A simple GL texture object abstraction.
This is used for low-level GL texture handling.
OpenGL::GLTexture::GLTexture | ( | GLenum | glIntFormat, |
GLenum | glFormat, | ||
GLenum | glType | ||
) |
Constrcut a new GL texture object.
glIntFormat | The internal format to use. |
glFormat | The input format. |
glType | The input type. |
void OpenGL::GLTexture::enableLinearFiltering | ( | bool | enable | ) |
Enable or disable linear texture filtering.
enable | true to enable and false to disable. |
|
inline |
Test whether linear filtering is enabled.
void OpenGL::GLTexture::setWrapMode | ( | WrapMode | wrapMode | ) |
Enable or disable linear texture filtering.
enable | true to enable and false to disable. |
void OpenGL::GLTexture::destroy | ( | ) |
Destroy the OpenGL texture name.
void OpenGL::GLTexture::create | ( | ) |
Create the OpenGL texture name.
void OpenGL::GLTexture::bind | ( | ) | const |
Bind the texture to the active texture unit.
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().
width | The desired logical width. |
height | The desired logical height. |
void OpenGL::GLTexture::updateArea | ( | const Common::Rect & | area, |
const Graphics::Surface & | src | ||
) |
Copy image data to the texture.
area | The area to update. |
src | Surface for the whole texture containing the pixel data to upload. Only the area described by area will be uploaded. |
|
inline |
Query the GL texture's width.
|
inline |
Query the GL texture's height.
|
inline |
Query the logical texture's width.
|
inline |
Query the logical texture's height.
|
inline |
Obtain texture coordinates for rectangular drawing.
|
inline |
Obtain texture name.
Beware that the texture name changes whenever create is used. destroy will invalidate the texture name.