SimpleGL  1.1.0
A framework for platform independent rendering
Public Member Functions | List of all members
sgl::Texture Class Reference

This class wraps an OpenGL texture object. More...

#include <texture_object.hpp>

Public Member Functions

 Texture (void)
 Generates a new texture object. More...
 
 ~Texture (void)
 Deletes the texture object. More...
 
GLuint getHandle ()
 Returns the handle of the texture object. More...
 
int getWidth ()
 Returns the width of the texture object. More...
 
int getHeight ()
 Returns the height of the texture object. More...
 
void bind ()
 Binds the texture object. More...
 
void generateMipMap ()
 Generates mipmaps for the texture object. More...
 
void setMinFilter (TextureFilter filter)
 Sets the minification filter of the texture object. More...
 
void setMagFilter (TextureFilter filter)
 Sets the magnification filter of the texture object. More...
 
void setWrapS (TextureWrap wrap)
 Sets the wrapping function of the texture object's coordinate S. More...
 
void setWrapT (TextureWrap wrap)
 Sets the wrapping function of the texture object's coordinate T. More...
 
void uploadImage (int width, int height, unsigned char *data)
 Uploads image data to the texture object. More...
 
void uploadImage (TextureData image)
 Uploads image data to the texture object. More...
 

Detailed Description

This class wraps an OpenGL texture object.

Definition at line 76 of file texture_object.hpp.

Constructor & Destructor Documentation

sgl::Texture::Texture ( void  )

Generates a new texture object.

Definition at line 15 of file texture_object.cpp.

sgl::Texture::~Texture ( void  )

Deletes the texture object.

Definition at line 19 of file texture_object.cpp.

Member Function Documentation

void sgl::Texture::bind ( )

Binds the texture object.

Definition at line 40 of file texture_object.cpp.

void sgl::Texture::generateMipMap ( )

Generates mipmaps for the texture object.

Definition at line 51 of file texture_object.cpp.

GLuint sgl::Texture::getHandle ( )

Returns the handle of the texture object.

Returns
The handle of the texture object.

Definition at line 28 of file texture_object.cpp.

int sgl::Texture::getHeight ( )

Returns the height of the texture object.

Returns
The height of the texture object in pixel.

Definition at line 36 of file texture_object.cpp.

int sgl::Texture::getWidth ( )

Returns the width of the texture object.

Returns
The width of the texture object in pixel.

Definition at line 32 of file texture_object.cpp.

void sgl::Texture::setMagFilter ( TextureFilter  filter)

Sets the magnification filter of the texture object.

Parameters
filterThe filter to set.

Definition at line 59 of file texture_object.cpp.

void sgl::Texture::setMinFilter ( TextureFilter  filter)

Sets the minification filter of the texture object.

Parameters
filterThe filter to set.

Definition at line 55 of file texture_object.cpp.

void sgl::Texture::setWrapS ( TextureWrap  wrap)

Sets the wrapping function of the texture object's coordinate S.

Parameters
wrapThe wrapping function to set.

Definition at line 63 of file texture_object.cpp.

void sgl::Texture::setWrapT ( TextureWrap  wrap)

Sets the wrapping function of the texture object's coordinate T.

Parameters
wrapThe wrapping function to set.

Definition at line 67 of file texture_object.cpp.

void sgl::Texture::uploadImage ( int  width,
int  height,
unsigned char *  data 
)

Uploads image data to the texture object.

Parameters
widthThe width of the image.
heightThe height of the image.
dataThe image data.

Definition at line 71 of file texture_object.cpp.

void sgl::Texture::uploadImage ( TextureData  image)

Uploads image data to the texture object.

Parameters
imageThe image data.

Definition at line 77 of file texture_object.cpp.


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