sgTexture Class Reference

#include <sgTexture.h>

Inheritance diagram for sgTexture:
sgBase

List of all members.

Public Member Functions

 sgTexture ()
 ~sgTexture ()
void createTexture2D (const char *filename, BOOL mipmaps=TRUE)
void createTexture2D (float width, float height)
void setParameteri (unsigned int pname, unsigned int param)

Static Public Member Functions

static sgTexturegetTexture2D (const char *filename, BOOL mipmaps=TRUE)

Public Attributes

unsigned int texid
unsigned int width
unsigned int height
BOOL loaded

Detailed Description

Texture class. Stores and handles a texture.


Constructor & Destructor Documentation

sgTexture::sgTexture (  ) 

Constructor. Initializes without a texture.

sgTexture::~sgTexture (  ) 

Deconstructor. Frees all memory allocated by this class.


Member Function Documentation

void sgTexture::createTexture2D ( float  width,
float  height 
)

Create 2D Texture. If there isn´t already a texture, this function creates a black one with the given dimensions.

Parameters:
width the width of the texture to create
height the height of the texture to create
void sgTexture::createTexture2D ( const char *  filename,
BOOL  mipmaps = TRUE 
)

Create 2D Texture. If there isn´t already a texture, this function loads it from the given file.

Parameters:
filename the name of the file to load
mipmaps has to be set to FALSE if you don´t want mipmaps to be created for this texture
sgTexture * sgTexture::getTexture2D ( const char *  filename,
BOOL  mipmaps = TRUE 
) [static]

Create 2D Texture from PVRTC file. If there isn´t already a texture, this function loads it from a PVRTS compressed file.

Parameters:
name the name of the file to load, without the type
w the width of the image can´t be set automatically
h the height of the image can´t be set automatically
type the type of the texture
mipmaps has to be set to FALSE if you don´t want mipmaps to be created for this texture
Returns:
pointer to the texture classes instance Get Texture. Creates and returns a pointer to a texture loaded from the given file.
Parameters:
filename the name of the file to load
mipmaps has to be set to FALSE if you don´t want mipmaps to be created for this texture
Returns:
pointer to the texture classes instance
void sgTexture::setParameteri ( unsigned int  pname,
unsigned int  param 
)

Get Texture from PVRTC file. Creates and returns a pointer to a texture loaded from a PVRTS compressed file.

Parameters:
name the name of the file to load, without the type
w the width of the image can´t be set automatically
h the height of the image can´t be set automatically
mipmaps has to be set to FALSE if you don´t want mipmaps to be created for this texture
Returns:
pointer to the texture classes instance Set texture parameter int. Sets the specified OpenGL parameter for the texture.
Parameters:
pname the parameter to set a new value for
param the new value

Member Data Documentation

unsigned int sgTexture::height

Height. The textures height.

Loaded. TRUE, if this texture is ready to be used.

unsigned int sgTexture::texid

Texture ID. The OpenGL ID of the texture.

unsigned int sgTexture::width

Width. The textures width.


The documentation for this class was generated from the following files:
Generated on Thu Jun 3 13:31:04 2010 for iSDGE by  doxygen 1.6.3