Archived

This topic is now archived and is closed to further replies.

porter_loring

SDL image loading problems

Recommended Posts

Hello, i started writing a program in linux that uses bmp and tga files and im using SDL for porting so i got the SDL_image lib and got everything running just right in linux. then i went to windows and got everything up and running without any problems except for 1. Everytime i load an image in windows using SDL its not being displayed correctly and tga files are not being texture mapped at all. i tested it with nehe texture map tutorial and instead of the image being displayed blue on the cube it was displayed with a reddish tint to it. this happens on every image i try ( a different tint for a different bmp file) i have NO idea whats going wrong because im using the code without any changes to test the image loading for SDL in windows (actually i had to change the GL_BGR to GL_RGB but thats the only change). has anyone had any problems like this and if so how do you fix it because my program looks really wack in the wrong colors! thanks porter

Share this post


Link to post
Share on other sites
wait... are you saying you changed GL_BGR to GL_RGB and you''re now getting your colors reversed? am I missing something?

The GL_BGR specifier indicates the color coordinate order for the texture map. GL_BGR is reversed from GL_RGB. I''m assuming that something prevented you from using GL_BGR in your windows code (like it''s not defined). You might try GL_EXT_BGR instead. I''ve noticed some default headers are lacking on occasion... dunno why.

Share this post


Link to post
Share on other sites
AHHHHHH,
thanks very much for pointing that out to me, i knew it had todo with that but i did not realize my stupid windows header was only opengl 1.1. and actually its GL_BGR_EXT. i thank you kindly for pointing me in the right direction. any ideas about the tga not being displayed correctly. i changed it to GL_BGRA_EXT and it runs correctly but the tga image isnt being mapped at all, just a big white space. im doing everything i did in linux with the SDL_image library so is there something small im missing here as well?

thanks
porter

Edited by - porter_loring on February 20, 2002 3:49:57 AM

Share this post


Link to post
Share on other sites