Jump to content
  • Advertisement
Sign in to follow this  
sinosoidal

OpenGL texture mapping - color problem

This topic is 4270 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

HI, I'm doing some texture mapping and it's working. My problem is with the colors. I also have problems with .jpg, nothing comes out. I'm using devil as image library and my code to load textures its the following: void LoadAllTextures(void) { ILubyte *imageData; ILuint image,w,h; ilInit(); iluInit(); ilutRenderer(ILUT_OPENGL); ilEnable (IL_CONV_PAL); ilutEnable (ILUT_OPENGL_CONV); ilGenImages(1,&image); ilBindImage(image); ilLoadImage("splash.bmp"); w = ilGetInteger(IL_IMAGE_WIDTH); h = ilGetInteger(IL_IMAGE_HEIGHT); imageData = ilGetData(); glNewList(actualImage = glGenLists(1), GL_COMPILE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); glTexImage2D(GL_TEXTURE_2D, 0, 4, w,h, 0, GL_RGB, GL_UNSIGNED_BYTE,imageData); glEndList(); } One image has blue tones and they become orange in the mapped texture. Other one is orange and becomes blue. This ones are the bmp's, because if i use a .jpg it doesnt give a thing. What am i doing wrong? Many thx, Best regards, Nuno Santos

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!