Textures Class Reference

The texture repository. More...

#include <Textures.h>

List of all members.

Static Public Member Functions

static void Load ()
static GLuint GetId (int texture_id)
static void Release ()

Private Member Functions

 Textures ()

Static Private Member Functions

static bool LoadBMP (char *file_name, GLuint texture_id)
static void CreatePerlinTexture (PerlinNoise *perlin, GLuint texture_id)
static void CreateTexture (GLuint tex_id, int size_x, int size_y, GLubyte *raw_data)

Static Private Attributes

static GLuint tex_id [MAX_TEXTURES]


Detailed Description

The texture repository.

A repository that stores all textures. Cannot be instantiated.

Definition at line 25 of file Textures.h.


Constructor & Destructor Documentation

Textures::Textures  )  [private]
 

Hide default constructor.


Member Function Documentation

void Textures::CreatePerlinTexture PerlinNoise perlin,
GLuint  texture_id
[static, private]
 

Creates a perlin texture of an arbitrary size.

Parameters:
perlin Pointer to a perlin noise class, which describes the actual noise.
texture_id The OpenGL texture name which the created perlin noise shall be bound to.

Definition at line 125 of file Textures.cpp.

void Textures::CreateTexture GLuint  tex_id,
int  size_x,
int  size_y,
GLubyte *  raw_data
[static, private]
 

Creates a mipmap texture.

Parameters:
tex_id The OpenGL texture name to identify the texture.
size_x Horizontal size of the texture to be created. Does not have to be a value of the form: size_x = 2^i.
size_y Vertical size of the texture to be created. Does not have bo be a value of the form: size_y = 2^i.
raw_data Pointer to a sequence of conecutive values between 0 and 255. Since a RGB format is required, the sequence exactly has to be of the size: size_x * size_y * 3.

Definition at line 138 of file Textures.cpp.

GLuint Textures::GetId int  texture_id  )  [static]
 

Returns the OpenGL identifier of a specific texture.

Parameters:
texture_id The identifier of the texture which shall be retrieved (see defines).
Returns:
The OpenGL identifier for the texture specified by 'texture_id'.

Definition at line 56 of file Textures.cpp.

void Textures::Load  )  [static]
 

Loads all the textures and sends them to the memory of the graphics card.

Definition at line 5 of file Textures.cpp.

bool Textures::LoadBMP char *  file_name,
GLuint  texture_id
[static, private]
 

Loads a windows bitmap file from disk (files with indexed colors not supported).

Parameters:
file_name A character sequence describing the file to load. example: "/Images/Test.bmp".
texture_id The OpenGL texture name which the loaded bitmap shall be bound to.
Returns:
true if this routine succeeded; false if this routine failed.

Definition at line 61 of file Textures.cpp.

void Textures::Release  )  [static]
 

Releases all textures.

Definition at line 51 of file Textures.cpp.


Member Data Documentation

GLuint Textures::tex_id [static, private]
 

Internally stores the OpenGL texture names.

Definition at line 51 of file Textures.h.


Generated on Sun Jul 2 13:20:41 2006 for Demo by  doxygen 1.4.6-NO