PDA

View Full Version : HELP !!! URGENT !!!



Tresher
08-11-2002, 04:12 AM
I have a tough problem http://www.opengl.org/discussion_boards/ubb/frown.gif((
i found out how to get a pointer to the pixel data of a bmp file !! and how to get the info about size etc.!!
The problem ?
i can use the data for an texture BUT red changes to blue, blue changes to red and green is the only color that is not changed. I have read in a book about windows programming that the internal order of an RGB image is rather BGR.
Now i have opengl 1.1 and therefore the GL_BGR format option isn`t available ! How can i solve this problem ??

Tresher
08-11-2002, 04:47 AM
By accident i have found a code line in some tutorial program that contained the symbolic constant GL_BGR_EXT. Now my program works.This was not mentioned in the RED BOOK. Maybe it is part of the 'extension system' ?? How do i find out what else might be supported, but not mentioned in the RED BOOK ?

Sincerely,
Martin.

Deiussum
08-11-2002, 05:53 AM
GL_BGR_EXT is an extension that Windows default software implementation of OpenGL even supports. To get a list of extensions that your card supports, you can use glGetString(GL_EXTENSIONS); To get information on those extensions, you can check the extension registry. There is a link to the extension registry somewhere on this site. I couldn't tell you where exactly it is offhand, though.

nexusone
08-11-2002, 08:34 AM
Another option is the switch from the BMP file format to TGA for you textures.
Easy to read file format, lot's of examples of loading TGA's and a format not owned by Micro$oft.

:-)



Originally posted by Tresher:
I have a tough problem http://www.opengl.org/discussion_boards/ubb/frown.gif((
i found out how to get a pointer to the pixel data of a bmp file !! and how to get the info about size etc.!!
The problem ?
i can use the data for an texture BUT red changes to blue, blue changes to red and green is the only color that is not changed. I have read in a book about windows programming that the internal order of an RGB image is rather BGR.
Now i have opengl 1.1 and therefore the GL_BGR format option isn`t available ! How can i solve this problem ??