Texture2D Class Reference

#include <Texture2D.h>

List of all members.

Public Member Functions

 Texture2D (void)
virtual ~Texture2D (void)
bool isInitialized () const
unsigned int getWidth () const
unsigned int getHeight () const
unsigned int getDepth () const
int getInternalFormat () const
void use () const
void useFramebuffer () const
bool createTextureFromFile (string filename, GLint internalFormat)
bool createTextureFromBuffer (unsigned int width, unsigned int height, GLint internalFormat, GLenum dataFormat, GLenum dataType, const void *buffer)
bool createTextureFromFramebuffer (unsigned int width, unsigned int height, GLint internalFormat, GLenum dataFormat, GLenum dataType)

Private Member Functions

void cleanUp ()
unsigned int getNextPowerOfTwo (unsigned int number) const

Private Attributes

GLuint m_texID
GLuint m_framebufferID
GLint m_internalFormat
unsigned int m_width
unsigned int m_height
bool m_initialized


Constructor & Destructor Documentation

Texture2D::Texture2D ( void   ) 

Texture2D::~Texture2D ( void   )  [virtual]


Member Function Documentation

void Texture2D::cleanUp (  )  [private]

cleans up all GL initializations and possible memory allocations

bool Texture2D::createTextureFromBuffer ( unsigned int  width,
unsigned int  height,
GLint  internalFormat,
GLenum  dataFormat,
GLenum  dataType,
const void *  buffer 
)

bool Texture2D::createTextureFromFile ( string  filename,
GLint  internalFormat 
)

bool Texture2D::createTextureFromFramebuffer ( unsigned int  width,
unsigned int  height,
GLint  internalFormat,
GLenum  dataFormat,
GLenum  dataType 
)

unsigned int Texture2D::getDepth (  )  const

unsigned int Texture2D::getHeight (  )  const

Returns:
Height of the texture

int Texture2D::getInternalFormat (  )  const

Returns:
an integer indicating the internal format of the 2D texture specified in the glTexImage2D() call

unsigned int Texture2D::getNextPowerOfTwo ( unsigned int  number  )  const [private]

Parameters:
number A number greater or equal to 0
Returns:
If number is 0, 1 is returned, if number is a power of two, number is returned, otherwise the next power of two.

unsigned int Texture2D::getWidth (  )  const

Returns:
Width of the texture

bool Texture2D::isInitialized (  )  const

Returns:
true, if the texture is initialized with some data

void Texture2D::use (  )  const

Binds the texture to prepare for following usage

void Texture2D::useFramebuffer (  )  const


Member Data Documentation

GLuint Texture2D::m_framebufferID [private]

unsigned int Texture2D::m_height [private]

bool Texture2D::m_initialized [private]

GLint Texture2D::m_internalFormat [private]

GLuint Texture2D::m_texID [private]

unsigned int Texture2D::m_width [private]


The documentation for this class was generated from the following files:

Generated on Wed Jan 21 13:33:57 2009 for InsightFlow by  doxygen 1.5.7.1