Problem with glTexImage2D()

Started by
3 comments, last by JClayton 19 years, 11 months ago
I have come across an error in my program where it crashes when glTexImage2D() is called. The function works correctly when a bitmap created in Paint is loaded... however when a bitmap created in Photoshop is loaded it crashes. When does glTexImage2D() crash and what are some of the possible causes?
Advertisement
Really, the only time it should crash is if the texture data you pass to it doesn''t match the type and format you say it is.
Post the code.
What kind of bmp are you trying to load? 8 or 24 bpp? Compressed or uncompressed?
The type is UNSIGNED_BYTE and i''m passing an unsigned char filled with the bitmap data. The bitmap is 24 bpp and is loaded into the following structure:

struct {  unsigned char* imageData;  int width;  int height;}IMAGE_FILE;
Ok, did you check if the bmp you are trying to load is 24 bpp, uncompressed?

This topic is closed to new replies.

Advertisement