mElite  1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | List of all members
TextureLoaderBMP Class Reference

An implementation of the TextureLoader that can load windows bitmaps. More...

#include <TextureLoaderBMP.h>

Inheritance diagram for TextureLoaderBMP:
TextureLoader

Public Member Functions

 TextureLoaderBMP (void)
 Default constructor, does nothing.
 
 ~TextureLoaderBMP (void)
 Default destructor, does nothing.
 
bool load (const std::string &filename)
 Loads a bitmap.
 
bool write (const std::string &filename)
 Does nothing, because writing bitmaps is not supported.
 
- Public Member Functions inherited from TextureLoader
 TextureLoader (void)
 Default constructor. Initializes variables and does nothing.
 
 ~TextureLoader (void)
 Destructor. Frees image data, if an image has been loaded.
 
bool load (BYTE *data, unsigned int width, unsigned int height, unsigned int bpp)
 Load an image from memory.
 
unsigned int getWidth (void)
 Returns the width of the image.
 
unsigned int getHeight (void)
 Gets the height of the image.
 
unsigned int getBPP (void)
 Gets the bits per pixel of the image. This is usually 24 or 32.
 
GLenum getFormat (void)
 Gets the OpenGL format of the image data.
 
BYTE * getImage ()
 Gets the actual image data as byte array.
 
void useBGR (bool value)
 Sets the color order to blue, green, red by force.
 
bool useBGR (void)
 Determines if BGR coloring is used, or not.
 
bool isBGR (void)
 Trys to decide, if BGR is the appropriate ording for the format of the current image.
 
void toRGB (void)
 Converts the image from BGR to RBG, if the image data is in BGR ordering.
 
void toBGR (void)
 Converts the image from RGB to BGR, if the image data is in RGB ordering.
 

Static Public Member Functions

static AUX_RGBImageRec * loadAux (const char *filename)
 Loads a Windows bitmap using auxDIBImageLoad function from the GLaux lib.
 

Additional Inherited Members

- Protected Member Functions inherited from TextureLoader
void setWidth (unsigned int width)
 Sets the width of the image.
 
void setHeight (unsigned int height)
 Sets the height of the image.
 
void setBPP (unsigned int bpp)
 Sets the number of bits per pixel for the image.
 
void setFormat (GLenum format)
 Sets the format of the image.
 
void setImage (BYTE **image)
 Sets the image data.
 
void setImage (BYTE *image)
 Sets the image data.
 
void bgr2rgb (unsigned __int8 colorMode)
 Convert the image data from BGR to RGB format.
 

Detailed Description

An implementation of the TextureLoader that can load windows bitmaps.

This class is basically an extension to the TextureLoader class which is capable to load bitmap textures. Therefore it overloads the load method of the base class. If this doesn't work the GLaux functions could be used as some kind of rescue.

Definition at line 21 of file TextureLoaderBMP.h.

Constructor & Destructor Documentation

TextureLoaderBMP::TextureLoaderBMP ( void  )

Default constructor, does nothing.

Definition at line 15 of file TextureLoaderBMP.cpp.

TextureLoaderBMP::~TextureLoaderBMP ( void  )

Default destructor, does nothing.

Definition at line 21 of file TextureLoaderBMP.cpp.

Member Function Documentation

bool TextureLoaderBMP::load ( const std::string &  filename)
virtual

Loads a bitmap.

It is currently only able to load windows bitmaps. It tests if the filetype is correct and calls the corresponding method.

Parameters
filenamezero terminated character array as filename

Implements TextureLoader.

Definition at line 51 of file TextureLoaderBMP.cpp.

AUX_RGBImageRec * TextureLoaderBMP::loadAux ( const char *  filename)
static

Loads a Windows bitmap using auxDIBImageLoad function from the GLaux lib.

Returns
A pointer to a AUX_RGBImageRec structure if loading was successful or NULL elsewise.
Parameters
filenamepointer to the file to load

Definition at line 29 of file TextureLoaderBMP.cpp.

bool TextureLoaderBMP::write ( const std::string &  filename)
virtual

Does nothing, because writing bitmaps is not supported.

Implements TextureLoader.

Definition at line 241 of file TextureLoaderBMP.cpp.


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