Texture2D Class Reference
[Basic]

Texture node for images. More...

#include <Texture2D.hpp>

Inheritance diagram for Texture2D:
Texture Node Applicable

List of all members.

Public Member Functions

 Texture2D (const Tag &tag)
virtual void associate ()
virtual GLint getRawFootprint () const
virtual int getSize () const
virtual string toString () const

Static Public Member Functions

static Texture2Dfind (Node *node, const string &name)

Protected Member Functions

virtual void generate ()
virtual void load ()

Static Protected Member Functions

static void initLibraries ()

Private Attributes

ILuint image
int size

Static Private Attributes

static bool librariesLoaded = false

Detailed Description

Texture node for images.


Constructor & Destructor Documentation

Texture2D ( const Tag tag  ) 

Creates a new 2D texture from an XML tag.

Parameters:
tag XML tag with "size" attributes.

Member Function Documentation

void associate (  )  [virtual]

Generates or loads the texture.

Is done here rather than finalize() because other nodes might need to get the texture's handle.

Exceptions:
NodeException from load()

Reimplemented from Texture.

Texture2D * find ( Node node,
const string &  name 
) [static]

Finds a Texture2D with a specific name.

Parameters:
node Node to start looking.
name Name of the node as specified by the user.
void generate (  )  [protected, virtual]

Generates a blank texture.

GLint getRawFootprint (  )  const [virtual]

How much memory the texture uses if uncompressed.

Implements Texture.

int getSize (  )  const [inline, virtual]
Returns:
width of the texture.
void initLibraries (  )  [static, protected]

Initializes required libraries, currently just DevIL.

Checks that DevIL libraries being run by the user are not older than the libraries used to compile Gander. If they are, warnings are issued. Either way DevIL is initialized by calling 'ilInit'.

Exceptions:
Exception if DevIL version is incorrect.
void load (  )  [protected, virtual]

Loads an image into the texture.

Exceptions:
NodeException if the libraries could not be loaded
NodeException if the image cannot be loaded
NodeException if the image cannot be bound as a texture
string toString (  )  const [virtual]

Forms a string from the object's attributes.

Reimplemented from Texture.


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