TextureInterface Class Reference

Represents a Masked Texture. More...

#include <TextureInterface.h>

Inherited by TextureAlpha, and TextureMasked.

Inheritance diagram for TextureInterface:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 TextureInterface ()
 Stadard costructor.
virtual ~TextureInterface ()
 Standard destructor.
virtual int render (double x_begin, double x_end, double y_begin, double y_end)=0
 Renders the plane with the textures on it.
virtual int loadAndBind (std::string p_filename, eTextureModification p_modifikationflag=TM_Masked_Normal)=0
 Loads and binds the texture and generates a mask and also binds it.
virtual int bind (TextureData *data)
 Binds the texture in OpenGL.

Public Attributes

double ratio
 Holds the ratio of the image.

Protected Member Functions

virtual TextureDataloadBMP (std::string p_filename)
 Loads the texture specified by the filename (BMP-file).
virtual TextureDataloadPNG (std::string p_filename)
 Loads the texture specified by the filename (PNG-file).

Static Private Attributes

static int s_handlerIndex = 1
 Increasing handler index.

Detailed Description

Represents a Masked Texture.

Definition at line 38 of file TextureInterface.h.


Constructor & Destructor Documentation

TextureInterface::TextureInterface (  ) 

Stadard costructor.

Definition at line 30 of file TextureInterface.cpp.

TextureInterface::~TextureInterface (  )  [virtual]

Standard destructor.

Definition at line 35 of file TextureInterface.cpp.


Member Function Documentation

virtual int TextureInterface::render ( double  x_begin,
double  x_end,
double  y_begin,
double  y_end 
) [pure virtual]

Renders the plane with the textures on it.

Returns:
0 for success.

Implemented in TextureAlpha, and TextureMasked.

Referenced by Texture::render().

virtual int TextureInterface::loadAndBind ( std::string  p_filename,
eTextureModification  p_modifikationflag = TM_Masked_Normal 
) [pure virtual]

Loads and binds the texture and generates a mask and also binds it.

Parameters:
p_filename Filename for the texture to load.
p_modifikationflag Flag for postprocess modifying.
Returns:
0 for success.

Implemented in TextureAlpha, and TextureMasked.

int TextureInterface::bind ( TextureData data  )  [virtual]

Binds the texture in OpenGL.

Parameters:
data The texture data.
Returns:
The handler for the specific texture.

Definition at line 81 of file TextureInterface.cpp.

References _BITMAPINFOHEADER::biHeight, _BITMAPINFOHEADER::biWidth, TextureData::infoheader, TextureData::l_texture, and s_handlerIndex.

Referenced by TextureMasked::loadAndBind(), and TextureAlpha::loadAndBind().

TextureData * TextureInterface::loadBMP ( std::string  p_filename  )  [protected, virtual]

Loads the texture specified by the filename (BMP-file).

Parameters:
p_filename Filename for the texture to load. BMP-File
Returns:
The data of the Texture

Definition at line 39 of file TextureInterface.cpp.

References _BITMAPINFOHEADER::biHeight, _BITMAPINFOHEADER::biWidth, TextureData::fileheader, TextureData::infoheader, TextureData::l_texture, TextureData::rgb, _RGBTRIPLE::rgbtBlue, _RGBTRIPLE::rgbtGreen, and _RGBTRIPLE::rgbtRed.

Referenced by TextureMasked::loadAndBind().

TextureData * TextureInterface::loadPNG ( std::string  p_filename  )  [protected, virtual]

Loads the texture specified by the filename (PNG-file).

Parameters:
p_filename Filename for the texture to load. PNG-File
Returns:
The data of the Texture

Definition at line 107 of file TextureInterface.cpp.

References _BITMAPINFOHEADER::biHeight, _BITMAPINFOHEADER::biWidth, TextureData::infoheader, and TextureData::l_texture.

Referenced by TextureAlpha::loadAndBind().


Member Data Documentation

double TextureInterface::ratio

Holds the ratio of the image.

Definition at line 78 of file TextureInterface.h.

Referenced by TextureMasked::loadAndBind(), TextureAlpha::loadAndBind(), and Texture::loadAndBind().

int TextureInterface::s_handlerIndex = 1 [static, private]

Increasing handler index.

Definition at line 101 of file TextureInterface.h.

Referenced by bind().


The documentation for this class was generated from the following files:
Generated on Tue Jul 17 22:02:23 2007 for C0re by  doxygen 1.5.2