mElite
1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
|
An implementation of the TextureLoader that can load windows bitmaps. More...
#include <TextureLoaderBMP.h>
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. | |
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.
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.
|
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.
filename | zero terminated character array as filename |
Implements TextureLoader.
Definition at line 51 of file TextureLoaderBMP.cpp.
|
static |
Loads a Windows bitmap using auxDIBImageLoad function from the GLaux lib.
filename | pointer to the file to load |
Definition at line 29 of file TextureLoaderBMP.cpp.
|
virtual |
Does nothing, because writing bitmaps is not supported.
Implements TextureLoader.
Definition at line 241 of file TextureLoaderBMP.cpp.