GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


bmploader.h by MaFiaBoY
#ifndef BMPLOADER_H
#define BMPLOADER_H

#include <string>
typedef unsigned char BYTE;

class BMPClass
{
public:
    BMPClass();
    ~BMPClass();
    BYTE& pixel(int x,int y,int c);
    void allocateMem();
    int width,height;
    BYTE* bytes;            //OpenGL formatted pixels
};

#define BMPError char
#define BMPNOTABITMAP 'b'    //Possible error flags
#define BMPNOOPEN 'o'
#define BMPFILEERROR 'f'
#define BMPNOERROR '\0'
#define BMPUNKNOWNFORMAT 'u'

//Loads the bmp in fname, and puts the data in bmp
BMPError BMPLoad(std::string fname,BMPClass& bmp);

//Translates my error codes into English    
std::string TranslateBMPError(BMPError err);    

//Load and select in OpenGL
BMPError BMPLoadGL(std::string fname);

#endif