PDA

View Full Version : A strange problem about texture by int data type



spring
11-02-2005, 07:47 AM
I use "int data" as teture data ,but it don't work why?
I modify the example program of red book checker.c
To change the GLubyte to int and modify the :
glTexImage2D(GL_TEXTURE_2D, 0, 3, checkImageWidth,
checkImageHeight, 0, GL_RGB, GL_INT,
&checkImage[0][0][0]);

it only display two black rectangle??

Racoon
11-02-2005, 08:32 AM
Color must be converted: c = c rol 24; (x86)
(0x000000ff to 0xff000000)

GL_INT color is cut off to [0x00000000 - 0x7f000000]

Me seem what 0-23 bits is not using, but it is guess.

Zulfiqar Malik
11-02-2005, 09:28 PM
If i understand you correctly:
GL_INT requires each pixel to be of 32-bit precision. You are probably using the same 8-bit texture, which might be causing problems.

Racoon
11-02-2005, 10:36 PM
GL_INT GL_RGB is 32*3 bits. I discussed about chanel, but it is named "color".