Texture Class Reference
[Basic]

OpenGL texture node. More...

#include <Texture.hpp>

Inheritance diagram for Texture:
Node Applicable Octree Texture2D Texture3D

List of all members.

Public Member Functions

 Texture (GLenum type, const Tag &tag)
virtual void apply ()
virtual void associate ()
virtual string getFilename () const
virtual GLint getFootprint () const
virtual GLuint getHandle () const
virtual GLint getRawFootprint () const =0
virtual string getName () const
virtual GLenum getType () const
virtual int getUnit () const
virtual bool isCompressed () const
virtual void remove ()
virtual string toString () const

Static Public Member Functions

static int getNumberOfActiveUnits ()
static void pause ()
static void restart ()
static list< Texture * > search (Node *node)

Protected Attributes

GLenum type
GLuint handle
int unit
string filename
string name

Static Private Attributes

static vector< GLenum > active_units

Detailed Description

OpenGL texture node.

Abstract base class for textures of various dimensions. Provides some basic texture capability, including finding an open texture unit and binding the texture to that unit. There are also two static methods, pause() and restart() that disable and reenable all active texture units.

Note:
Add unit to GL_TEXTURE0 when passing directly to OpenGL.
See also:
Texture2D
Texture3D

Constructor & Destructor Documentation

Texture ( GLenum  type,
const Tag tag 
)

Creates a new texture from an XML tag.

Parameters:
[in] type 1D, 2D, or 3D.
[in] tag XML tag with "type", "name", and "filename" attributes.

Member Function Documentation

void apply (  )  [virtual]

Applies the texture.

Implements Applicable.

void associate (  )  [virtual]

Finds out which texture unit to use by looking for texture ancestors.

Reimplemented from Node.

Reimplemented in Octree, and Texture2D.

string getFilename (  )  const [inline, virtual]
Returns:
Path to the file this texture was loaded from.
GLint getFootprint (  )  const [virtual]
Returns:
How much memory the texture uses.
GLuint getHandle (  )  const [inline, virtual]
Returns:
OpenGL's unique identifier for this texture.
string getName (  )  const [inline, virtual]
Returns:
User's unique identifier for this texture.
int getNumberOfActiveUnits (  )  [inline, static]
Returns:
Number of texture units being used.
GLenum getType (  )  const [inline, virtual]
Returns:
GL_TEXTURE_1D, GL_TEXTURE_2D, or GL_TEXTURE_3D.
int getUnit (  )  const [inline, virtual]
Returns:
Texture unit holding the data.
bool isCompressed (  )  const [virtual]

Checks if the texture was successfully compressed.

void pause (  )  [static]

Temporarily disables texturing on all active units.

void remove (  )  [virtual]

Removes the texture.

Implements Applicable.

void restart (  )  [static]

Renables texturing on all active units.

list< Texture * > search ( Node node  )  [static]

Discover all texture nodes under a node.

string toString (  )  const [virtual]

Forms a string using the Texture's attributes.

Reimplemented from Node.

Reimplemented in Octree, Texture2D, and Texture3D.


The documentation for this class was generated from the following files:
Generated on Wed Jun 9 01:36:37 2010 for Gander by  doxygen 1.6.3