Skip to main content
gamedev.net
🔒 Locked

Loading this .bmp causes a runtime error....

Started by bballmitch Jun 1, 2006 at 6:16 PM 1 replies 650+ views
Original Post
bballmitch
bballmitch

glBindTexture(GL_TEXTURE_2D, textures[3]); 
     textureData = LoadBitmapFile("rockstileable.bmp", &textureInfoHeader);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, textureInfoHeader.biWidth, textureInfoHeader.biHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, textureData);

It compiles, but when i run the program, I get a runtime error and the program won't run. :( rockstileable.bmp is definitly in the right location, but I don't know why I'm getting this error. I load a bunch of other .bmp files , but this one is causing trouble. :(
Mitchen Games
JBourrie
JBourrie
It's probably because it's called rockstileable.bmp :)

Seriously, that's all we know about it, and that's not nearly enough information to debug this one.

Is there no error checking in LoadBitmapFile? Is this your own function (in which case you should debug by stepping through it)?

The .bmp might be corrupted, or it may be in a format that you don't support (like 256 color), but theres no telling just by having the name of the file in a short code snippet.
Mushu
Mushu
I recommend stepping through it with your favorite debugger (or just checking the stack trace) to find out exactly which line is causing the error. This will greatly aide your bug-finding.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.