Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

peon::SceneTexture Class Reference

This object encapsulates the "magic" behind loading and manipulating texture data. More...

#include <SceneTexture.h>

Inheritance diagram for peon::SceneTexture:

peon::IUnknown List of all members.

Public Member Functions

 SceneTexture ()
 Constructor.
 ~SceneTexture ()
 Destructor.
bool loadImage (const String &strFilename, bool bAlpha, bool bMipMaps, bool bRepeat)
 This method loads the image into this object and gets everything correctly configured for use in the pipeline.
GLuint getTex ()
 This method just returns the handle to our texture data.

Protected Member Functions

Uint32 getPixel (SDL_Surface *surface, int x, int y)
 Method to scan the surface at particular coordinates to grab the pixel data.

Protected Attributes

GLuint m_tex
 OpenGL-specific texture handle.

Detailed Description

This object encapsulates the "magic" behind loading and manipulating texture data.

Right now, it's a very simplistic container but to start with, that's all we need. It can handle any image format supported by the SDL_Image helper library. For the most part, I usually try to stick with BMP's, TGA's and PNG's.


Member Function Documentation

Uint32 peon::SceneTexture::getPixel SDL_Surface *  surface,
int  x,
int  y
[protected]
 

Method to scan the surface at particular coordinates to grab the pixel data.

Parameters:
surface - SDL_Surface object to work with
x - x coordinate
y - y coordinate
Returns:
Uint32 - unsigned integer representing pixel info

GLuint peon::SceneTexture::getTex  )  [inline]
 

This method just returns the handle to our texture data.

Returns:
GLuint - texture data handle

bool peon::SceneTexture::loadImage const String &  strFilename,
bool  bAlpha,
bool  bMipMaps,
bool  bRepeat
 

This method loads the image into this object and gets everything correctly configured for use in the pipeline.

Parameters:
strFilename - filename of texture
bAlpha - do we want the alpha channel?
bMipMaps - do we want to create mipmaps?
bRepeat - do we want to repeat this texture?
Returns:
bool - true if we're all ok


The documentation for this class was generated from the following file:
Generated on Thu Dec 1 01:55:41 2005 for Peon by  doxygen 1.4.1