Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

gl::texture Class Reference

OpenGL specific texture handle. More...

#include <texture.h>

List of all members.

Public Methods

 texture (void)
 Default Constructor.

 texture (const texture &cpy)
 Copy Constructor.

texture & operator= (const texture &cpy)
 Assignment Operator.

void set (GLuint handle, real_t aspect)
 Sets all aspects of the texture object.

 operator GLuint (void) const
 Cast to GLuint.

void erase (void)
 Removes the texture from the OpenGL subsystem.

void bind (void) const
 Binds the texture in OpenGL.

real_t get_aspect (void) const
 Returns the aspect ratio of the image (width / height).


Static Public Methods

void set_greyscale_format (GLenum format)
 What format OpenGL will load greyscale data in.

texture load (const std::string &filename, bool build_mipmaps=true, GLfloat min_filter=GL_LINEAR_MIPMAP_LINEAR, GLfloat max_filter=GL_LINEAR)
 Loads the texture filename into the OpenGL subsystem. More...

texture load (std::istream &stream, bool build_mipmaps=true, GLfloat min_filter=GL_LINEAR_MIPMAP_LINEAR, GLfloat max_filter=GL_LINEAR)
 Loads the stream as a texture into the OpenGL subsystem. More...

texture load (image::image_t *img, bool build_mipmaps=true, GLfloat min_filter=GL_LINEAR_MIPMAP_LINEAR, GLfloat max_filter=GL_LINEAR)
 Loads the image_t* as a texture into the OpenGL subsystem. More...


Static Public Attributes

GLenum s_greyscale_format = GL_LUMINANCE


Detailed Description

OpenGL specific texture handle.

This object represents a texture loaded into the OpenGL subsystem. Using the object is as simple as:

 //load the texture
 gl::texture tex = gl::texture::load( "filename" );
 if( !tex ) {
     std::cerr << "could not load texture" << std::endl;
 }

 //use the texture
 glBindTexture( GL_TEXTURE_2D, tex );
 // . . .

Definition at line 37 of file texture.h.


Member Function Documentation

gl::texture gl::texture::load image::image_t   img,
bool    build_mipmaps = true,
GLfloat    min_filter = GL_LINEAR_MIPMAP_LINEAR,
GLfloat    max_filter = GL_LINEAR
[static]
 

Loads the image_t* as a texture into the OpenGL subsystem.

Note:
By default, mipmaps are built and trilinear filtering is used.
Parameters:
build_mimaps  If mipmaps should be built.
min_filter  OpenGL minification filter.
min_filter  OpenGL magnification filter.

Definition at line 81 of file texture.cpp.

References image::image_t::BYTE, image::image_t::get_bpc, image::image_t::get_format, image::image_t::get_height, image::image_t::get_pixels, image::image_t::get_width, image::image_t::GREYSCALE, image::image_t::RGB, image::image_t::RGBA, and texture.

gl::texture gl::texture::load std::istream &    stream,
bool    build_mipmaps = true,
GLfloat    min_filter = GL_LINEAR_MIPMAP_LINEAR,
GLfloat    max_filter = GL_LINEAR
[static]
 

Loads the stream as a texture into the OpenGL subsystem.

Note:
By default, mipmaps are built and trilinear filtering is used.
Parameters:
build_mimaps  If mipmaps should be built.
min_filter  OpenGL minification filter.
min_filter  OpenGL magnification filter.

Definition at line 49 of file texture.cpp.

References image::image_t::flip_horizontal, load, image::load, and texture.

gl::texture gl::texture::load const std::string &    filename,
bool    build_mipmaps = true,
GLfloat    min_filter = GL_LINEAR_MIPMAP_LINEAR,
GLfloat    max_filter = GL_LINEAR
[static]
 

Loads the texture filename into the OpenGL subsystem.

Note:
By default, mipmaps are built and trilinear filtering is used.
Parameters:
build_mimaps  If mipmaps should be built.
min_filter  OpenGL minification filter.
min_filter  OpenGL magnification filter.

Definition at line 18 of file texture.cpp.

References image::image_t::flip_horizontal, image::load, and texture.

Referenced by gl::ttf::load, and load.


Generated on Tue Feb 11 18:49:48 2003 for uber by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002