Texture Class Reference

#include <TextureUtils.h>

List of all members.

Public Member Functions

 Texture (GLuint target=GL_TEXTURE_2D)
 Texture (const Texture &copy)
Textureoperator= (const Texture &)
 ~Texture ()
virtual bool loadXMLSettings (const TiXmlElement *element)
virtual bool exportXMLSettings (std::ofstream &xmlFile)
bool load2D (const char *infoEndOrPath, GLuint clampS=GL_REPEAT, GLuint clampT=GL_REPEAT, GLuint magFilter=GL_LINEAR, GLuint minFilter=GL_LINEAR_MIPMAP_LINEAR, bool mipmap=true)
bool load2DImage (const Image &image, GLuint clampS=GL_REPEAT, GLuint clampT=GL_REPEAT, GLuint magFilter=GL_LINEAR, GLuint minFilter=GL_LINEAR_MIPMAP_LINEAR, bool mipmap=true)
void copyCurrentBuffer (int newTarget=-1)
const bool activate (GLuint unit=0)
const bool deactivate ()
void setID (GLuint textureID)
const GLuint getID () const
void setTarget (GLuint target)
const GLuint getTarget () const
const GLuint getHeight () const
const GLuint getWidth () const
const GLuint getDepth () const
void destroy ()

Protected Attributes

GLuint height
GLuint width
GLuint depth

Private Member Functions

bool loadTextureFace (const Image &image, GLuint target, bool mipmap)
bool finalizeLoading (const char *string)
bool checkForRepeat (const char *string)
int getMagFilteri (const std::string &value)
int getMinFilteri (const std::string &value)
int getWrapModei (const std::string &value)
int getTypei (const std::string &value)
int getValidWrapMode (int clamp)
int getValidMagFilter (int filter)
int getValidMinFilter (int filter)

Private Attributes

GLuint currUnit
GLuint target
GLuint id


Detailed Description

Definition at line 193 of file TextureUtils.h.


Constructor & Destructor Documentation

Texture::Texture ( GLuint  target = GL_TEXTURE_2D  ) 

Definition at line 13 of file TextureUtils.cpp.

References currUnit, depth, height, target, and width.

Texture::Texture ( const Texture copy  ) 

Definition at line 23 of file TextureUtils.cpp.

References currUnit, depth, height, operator=(), target, and width.

Texture::~Texture (  ) 

Definition at line 323 of file TextureUtils.cpp.

References destroy().


Member Function Documentation

Texture & Texture::operator= ( const Texture copy  ) 

Definition at line 34 of file TextureUtils.cpp.

References currUnit, depth, height, id, setID(), target, and width.

Referenced by Texture().

bool Texture::loadXMLSettings ( const TiXmlElement *  element  )  [virtual]

Definition at line 150 of file TextureUtils.cpp.

References getMagFilteri(), getMinFilteri(), getTypei(), getWrapModei(), load2D(), target, and Logger::writeErrorLog().

Referenced by GUIClippedRectangle::loadXMLClippedRectangleInfo(), and GUIFrame::loadXMLSettings().

virtual bool Texture::exportXMLSettings ( std::ofstream &  xmlFile  )  [virtual]

bool Texture::load2D ( const char *  infoEndOrPath,
GLuint  clampS = GL_REPEAT,
GLuint  clampT = GL_REPEAT,
GLuint  magFilter = GL_LINEAR,
GLuint  minFilter = GL_LINEAR_MIPMAP_LINEAR,
bool  mipmap = true 
)

Definition at line 328 of file TextureUtils.cpp.

References checkForRepeat(), Image::load(), load2DImage(), MediaPathManager::lookUpMediaPath(), and Logger::writeErrorLog().

Referenced by Lights::Init(), loadXMLSettings(), and GUIFrame::setElementsTexture().

bool Texture::load2DImage ( const Image image,
GLuint  clampS = GL_REPEAT,
GLuint  clampT = GL_REPEAT,
GLuint  magFilter = GL_LINEAR,
GLuint  minFilter = GL_LINEAR_MIPMAP_LINEAR,
bool  mipmap = true 
)

Definition at line 349 of file TextureUtils.cpp.

References checkForRepeat(), depth, destroy(), finalizeLoading(), Image::getHeight(), Image::getPath(), getValidMagFilter(), getValidMinFilter(), getValidWrapMode(), Image::getWidth(), height, loadTextureFace(), target, width, Logger::writeErrorLog(), and Logger::writeInfoLog().

Referenced by load2D().

void Texture::copyCurrentBuffer ( int  newTarget = -1  ) 

Definition at line 85 of file TextureUtils.cpp.

References activate(), deactivate(), height, target, and width.

const bool Texture::activate ( GLuint  unit = 0  ) 

Definition at line 71 of file TextureUtils.cpp.

References currUnit, and target.

Referenced by copyCurrentBuffer(), GUIFrame::enableGUITexture(), Lights::Init(), GUIClippedRectangle::renderClippedBounds(), and setID().

const bool Texture::deactivate (  ) 

Definition at line 96 of file TextureUtils.cpp.

References target.

Referenced by copyCurrentBuffer(), GUIFrame::disableGUITexture(), GUIClippedRectangle::renderClippedBounds(), and setID().

void Texture::setID ( GLuint  textureID  ) 

Definition at line 107 of file TextureUtils.cpp.

References activate(), deactivate(), TexturesManager::getTextureInfo(), height, MediaInfo< MediaInfoType >::increaseUserCount(), target, width, and Logger::writeErrorLog().

Referenced by checkForRepeat(), and operator=().

const GLuint Texture::getID (  )  const

Definition at line 148 of file TextureUtils.cpp.

References id.

Referenced by Lights::DrawLights(), GUIFrame::enableGUITexture(), GUIFrame::getElementsTexture(), GUIClippedRectangle::renderClippedBounds(), and GUIClippedRectangle::setTextureRectangle().

void Texture::setTarget ( GLuint  target  ) 

Definition at line 143 of file TextureUtils.cpp.

References target.

const GLuint Texture::getTarget (  )  const

Definition at line 144 of file TextureUtils.cpp.

References target.

const GLuint Texture::getHeight (  )  const

Definition at line 145 of file TextureUtils.cpp.

References height.

Referenced by GUIFrame::loadXMLSettings(), and GUIClippedRectangle::setTextureRectangle().

const GLuint Texture::getWidth (  )  const

Definition at line 146 of file TextureUtils.cpp.

References width.

Referenced by GUIFrame::loadXMLSettings(), and GUIClippedRectangle::setTextureRectangle().

const GLuint Texture::getDepth (  )  const

Definition at line 147 of file TextureUtils.cpp.

References depth.

void Texture::destroy (  ) 

Definition at line 306 of file TextureUtils.cpp.

References MediaInfo< MediaInfoType >::decreaseUserCount(), depth, TexturesManager::flushUnusedTextures(), TexturesManager::getTextureInfo(), height, and width.

Referenced by GUIFrame::clear(), load2DImage(), and ~Texture().

bool Texture::loadTextureFace ( const Image image,
GLuint  target,
bool  mipmap 
) [private]

Definition at line 889 of file TextureUtils.cpp.

References Image::getDataBuffer(), Image::getFormat(), Image::getHeight(), Image::getInternalFormat(), Image::getWidth(), and Logger::writeErrorLog().

Referenced by load2DImage().

bool Texture::finalizeLoading ( const char *  string  )  [private]

Definition at line 59 of file TextureUtils.cpp.

References TexturesManager::addTextureInfo(), and Logger::writeErrorLog().

Referenced by load2DImage().

bool Texture::checkForRepeat ( const char *  string  )  [private]

Definition at line 49 of file TextureUtils.cpp.

References MediaInfo< MediaInfoType >::getMedia(), TexturesManager::getTextureInfo(), and setID().

Referenced by load2D(), and load2DImage().

int Texture::getMagFilteri ( const std::string &  value  )  [private]

Definition at line 211 of file TextureUtils.cpp.

Referenced by loadXMLSettings().

int Texture::getMinFilteri ( const std::string &  value  )  [private]

Definition at line 220 of file TextureUtils.cpp.

Referenced by loadXMLSettings().

int Texture::getWrapModei ( const std::string &  value  )  [private]

Definition at line 233 of file TextureUtils.cpp.

Referenced by loadXMLSettings().

int Texture::getTypei ( const std::string &  value  )  [private]

Definition at line 244 of file TextureUtils.cpp.

Referenced by loadXMLSettings().

int Texture::getValidWrapMode ( int  clamp  )  [private]

Definition at line 255 of file TextureUtils.cpp.

Referenced by load2DImage().

int Texture::getValidMagFilter ( int  filter  )  [private]

Definition at line 263 of file TextureUtils.cpp.

Referenced by load2DImage().

int Texture::getValidMinFilter ( int  filter  )  [private]

Definition at line 268 of file TextureUtils.cpp.

Referenced by load2DImage().


Member Data Documentation

GLuint Texture::height [protected]

Definition at line 300 of file TextureUtils.h.

Referenced by copyCurrentBuffer(), destroy(), getHeight(), load2DImage(), operator=(), setID(), and Texture().

GLuint Texture::width [protected]

Definition at line 300 of file TextureUtils.h.

Referenced by copyCurrentBuffer(), destroy(), getWidth(), load2DImage(), operator=(), setID(), and Texture().

GLuint Texture::depth [protected]

Definition at line 300 of file TextureUtils.h.

Referenced by destroy(), getDepth(), load2DImage(), operator=(), and Texture().

GLuint Texture::currUnit [private]

Definition at line 304 of file TextureUtils.h.

Referenced by activate(), operator=(), and Texture().

GLuint Texture::target [private]

Definition at line 304 of file TextureUtils.h.

Referenced by activate(), copyCurrentBuffer(), deactivate(), getTarget(), load2DImage(), loadXMLSettings(), operator=(), setID(), setTarget(), and Texture().

GLuint Texture::id [private]

Definition at line 304 of file TextureUtils.h.

Referenced by getID(), and operator=().


The documentation for this class was generated from the following files:
Generated on Wed Dec 5 20:32:03 2007 for GLWX by  doxygen 1.5.3