#include <lvt/Texture.h>
Inheritance diagram for Texture:
To create a texture object, first instantiate the class, then call Load to load pixel data into the texture object. If the texture is stored externally in one of the supported file formats (See Texture::Load for a list), then you call Load with the filename of the pixel data and the object will read the data from file.
If the file format is generated procedurally, stored internally, or not in one of the supported file formats, Load can be called with approximately the same arguments as glTexture*D.
Both versions of Load will automatically generate mipmaps if they are not present in the source file.
To disable texturing in part of a scenegraph, create an empty texture object and disable it with State::Disable(). Then attach the object to the scenegraph at the point you want textures disabled.
Public Member Functions | |
GLenum | GetMagFilter () const |
Returns the current magnification filter for the texture object. | |
GLenum | GetMinFilter () const |
Returns the current minification filter for the texture object. | |
GLenum | GetWrapR () const |
Returns the current texture wrap mode in the R direction. | |
GLenum | GetWrapS () const |
Returns the current texture wrap mode in the S direction. | |
GLenum | GetWrapT () const |
Returns the current texture wrap mode in the T direction. | |
virtual bool | Load (unsigned int x, unsigned int y, const unsigned char *bitmap, int border=0, GLint internalFormat=GL_RGBA8, GLenum externalFormat=GL_RGBA, GLenum type=GL_UNSIGNED_BYTE) |
Creates a new texture object with the specified pixel data. | |
virtual bool | Load (const std::string &fileName) |
Creates a new texture object and loads pixel data from a file. | |
virtual void | Render ()=0 |
Binds the texture to its texture unit, and enables texturing, if necessary. | |
void | SetMagFilter (GLenum filter) |
Sets the magnification filter. | |
void | SetMinFilter (GLenum filter) |
Sets the minification filter for the texture object. | |
void | SetWrap (GLenum s, GLenum t, GLenum r=GL_REPEAT) |
Sets the current texture wrap mode. |
|
Returns the current magnification filter for the texture object.
|
|
Returns the current minification filter for the texture object.
|
|
Returns the current texture wrap mode in the R direction.
|
|
Returns the current texture wrap mode in the S direction.
|
|
Returns the current texture wrap mode in the T direction.
|
|
Creates a new texture object with the specified pixel data.
|
|
Creates a new texture object and loads pixel data from a file. The following file formats are supported:
|
|
Binds the texture to its texture unit, and enables texturing, if necessary.
Implements TextureState. |
|
Sets the magnification filter.
|
|
Sets the minification filter for the texture object.
|
|
Sets the current texture wrap mode.
|