Texture node for images. More...
#include <Texture2D.hpp>
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 Texture2D * | find (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 |
Texture node for images.
Creates a new 2D texture from an XML tag.
tag | XML tag with "size" attributes. |
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.
NodeException | from load() |
Reimplemented from Texture.
Finds a Texture2D with a specific name.
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] |
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'.
Exception | if DevIL version is incorrect. |
void load | ( | ) | [protected, virtual] |
Loads an image into the texture.
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.