Texture2D Class Reference

#include <VisTexture2D.hpp>

List of all members.

Public Member Functions

 Texture2D (const char *path, GLenum wrapS=GL_REPEAT, GLenum wrapT=GL_REPEAT, GLenum magFilter=GL_LINEAR, GLenum minFilter=GL_LINEAR_MIPMAP_LINEAR)
 Texture2D (V2i size, Color4f color=Color4f(0.0), GLenum wrapS=GL_REPEAT, GLenum wrapT=GL_REPEAT, GLenum magFilter=GL_LINEAR, GLenum minFilter=GL_LINEAR_MIPMAP_LINEAR)
 Texture2D (V2i size, Color4f *pixels, GLenum wrapS=GL_REPEAT, GLenum wrapT=GL_REPEAT, GLenum magFilter=GL_LINEAR, GLenum minFilter=GL_LINEAR_MIPMAP_LINEAR)
V2i get_size ()
 Returns the size of the texture.
Color4f * get_pixels ()
 Returns a reference to the pixel data.
void send_to_GPU ()
void build_mipmaps ()
void bind (GLuint texUnit)
GLuint get_texture_name ()


Detailed Description

Texture2D is our RGBA image texture class. It features several methods for loading the texel data, like direct file access, or creating a blank texture on construction.

Constructor & Destructor Documentation

Texture2D::Texture2D ( const char *  path,
GLenum  wrapS = GL_REPEAT,
GLenum  wrapT = GL_REPEAT,
GLenum  magFilter = GL_LINEAR,
GLenum  minFilter = GL_LINEAR_MIPMAP_LINEAR 
)

Loads a texture from a file. The loader will check the file-extension, to find out the format of the image. At the moment, only OpenEXR ist supported.

Texture2D::Texture2D ( V2i  size,
Color4f  color = Color4f(0.0),
GLenum  wrapS = GL_REPEAT,
GLenum  wrapT = GL_REPEAT,
GLenum  magFilter = GL_LINEAR,
GLenum  minFilter = GL_LINEAR_MIPMAP_LINEAR 
)

Creates a blank texture. This can be useful for procedural textures e.g. for effects or for the preparation of a renderbuffer.

Texture2D::Texture2D ( V2i  size,
Color4f *  pixels,
GLenum  wrapS = GL_REPEAT,
GLenum  wrapT = GL_REPEAT,
GLenum  magFilter = GL_LINEAR,
GLenum  minFilter = GL_LINEAR_MIPMAP_LINEAR 
)

Creates a texture, by making a copy of the supplied surface.


Member Function Documentation

void Texture2D::build_mipmaps (  ) 

Rebuild the mipmap-Levels of the texture.

GLuint Texture2D::get_texture_name (  )  [inline]

Returns the openGL texture name of this texture.

void Texture2D::send_to_GPU (  ) 

Load the pixel data as texture. You only have to use this, when the pixel-data has changed. This will be done automatically, a Texture-contruction.


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

Generated on Wed Dec 10 14:41:01 2008 by  doxygen 1.5.7.1