PDA

View Full Version : Red and Blue texture switch



KShots
11-17-2002, 06:42 PM
Hello, I finally got my textures working, and ran into a problem http://www.opengl.org/discussion_boards/ubb/frown.gif. The graphic artist I'm working with walked by and said that I switched the red and the blue around! Well, I thought it should be a really simple matter telling OpenGL that I want it to read it in that order instead...but the documentation does not appear to match reality http://www.opengl.org/discussion_boards/ubb/frown.gif. I am currently using the format parameter GL_RGB, which is documented on Pg. 95 of the GL API documentation from this site. Also on that page is a format called "GL_BGR". My compiler accepts the first and rejects the latter. Why?! Any suggestions? Or do I have to figure out how to read the texture and switch the red bits with the blue bits during read-time?

Deiussum
11-18-2002, 04:49 AM
Try using GL_BGR_EXT.

KShots
11-18-2002, 07:46 AM
Yeah, that fixed it. Thanks! Is there any place that has the correct formats listed so I can reference that instead of the other thing I was using?

Deiussum
11-18-2002, 09:26 AM
You could check MSDN for info like that. Or there's always the old stand-by of checking the headers as well. http://www.opengl.org/discussion_boards/ubb/smile.gif

You were probably looking at docs for 1.2 or higher, and the headers and library for Windows is 1.1. In order to get 1.2 functions, etc. you can also find glext.h (nvidia.com has it somewhere) and use wglGetProcAddress to get funcion pointers to the 1.2+ functions.