Sorry for the late reply, been busy and haven't had time to check this. Here's the function, LIMAGE is a struct that contains width, height, type and a char* to hold image data.
Code:
LIMAGE BMPLoader::loadBMP(const char* filename) {
struct {
unsigned short int type;
unsigned int filesize;
unsigned int reserved;
unsigned int offset;
} header;
struct {
unsigned int headersize;
unsigned int width, height;
unsigned short int planes;
unsigned short int bitsppx;
unsigned int compression, imagesize, hres, vhres, numcolors, importantcols;
} infoheader;
char* palette = 0;
char* imaged = 0;
LIMAGE image = {0, 0, 0, 0};
if (filename == 0) return image;
FILE* file = 0;
file = fopen(filename, "rb");
if (file == 0) return image;
}
That is in loaders\bmploader.cpp. In the main CPP, in my init function I have this:
Code:
LIMAGE temp = BMPLoader::loadBMP("test.bmp");
I do a check and temp contains all zeros. I did a test within in the function earlier, the filename was going through fine, for some reason fopen can't locate the file. Any ideas?