PDA

View Full Version : BMP allgo , question loading bmp



punky
10-15-2009, 12:00 AM
if i load a bmp, the colors are strange, i mean teal is displayed as yellow and yellow is displayed as teal

whats the problem?
like it should be:
http://sites.google.com/site/csourcecodes/home/opengl/bmps/text_100x100.bmp

like it is:
http://sites.google.com/site/csourcecodes/home/opengl/bmps/text_100x100_wrong.bmp

ZbuffeR
10-15-2009, 04:40 AM
RGB versus BGR, watch how you load the .bmp file and how you send data to opengl texture with glTexImage2D.

punky
10-15-2009, 03:09 PM
i load it with fread into a char buffer
how it comes from gimp, so i need to load it reverse?

punky
10-15-2009, 03:32 PM
thanx i use it like this now
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,bmfh.width , bmfh.height, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, bData.DATA);

the GL_BGR_EXT, is the clou
and its fine