About glDrawPixels()

Started by
1 comment, last by goyg 15 years, 9 months ago
glDrawPixels(),Is this function should be used in the last of rendering? If I want to render after operating with pixels, but the picture which I get in the screen is the fragment which I get with the function glDrawPixels().The rendering after this function doesn't work. My operate order is: first rendering ---> glReadPixels() ---> glDrawPixels() ---> second rendering. I just want to know what should I do if I want to get the correct rendering. [Edited by - goyg on July 18, 2008 8:05:22 PM]
Advertisement
You can use glDrawPixels whenever you want. Just remember that it generates fragments just like any other rendering. It is effected by depth testing, stencil, enabled textures, enabled lighting, shaders, etc.

Quote:If I want to render after operate with pixels, how can I do?

What?
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
I think I have found the reason why the second rendering fail.
glDrawPixels() send the pixels to the fragment ,but it doesn't have any other buffers(z-buffer and the others).When do the second rendering , the fragment test will drop the second rendering. So the the second rendering doesn't work.

This topic is closed to new replies.

Advertisement