PDA

View Full Version : glColorMask() question



SLeo
10-08-2006, 09:28 PM
Hi, I have one problem.
In description of void glClear(GLbitfield mask); I have read this "Masking operations, such as glColorMask() and glIndexMask(), are also effective". So I do this:

glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_TRUE);
glClearColor(0,0,0,0.5); // unsigned byte (0,0,0,127) right?
glClear(GL_COLOR_BUFFER_BIT);
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
glCopyTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,0,0,Windo wWidth,WindowHeight,0); // my window is 1024x768
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, pTextureData); // its rectangular texture, same resolution 1024x768, belive me :)And then I try to look alpha component, for example, pTextureData[3] its not equal to 127. Help me plz?

10-08-2006, 11:10 PM
if it's not 127, then what is it?

does your pixelformat have alphaBits?

Relic
10-09-2006, 01:14 AM
Do not crosspost please. There are answers in the advanced forum.