Hi to all,
it may be sound impossible, but i am having problems
with glDrawPixels()
I am using a glut program example made by others (it is
one of the bullet sdk demo examples).
I want to display and image and do rendering on it. If i use, in the glutMoveAndDisplayCallback(), the glDrawPixels in this way:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDisable(GL_DEPTH_TEST);
glDrawPixels(640, 480, GL_RGBA, GL_UNSIGNED_BYTE, imageBuffer);
glEnable(GL_DEPTH_TEST);
glSwapBuffers();
all works ok! If, instead of calling glSwapBuffers(), i do
some other rendering stuff (like the ones made by the bullet sdk demo), and finally call glSwapBuffers(), i cannot see anything.
The other rendering stuff makes change to (eventually) the projection matrix, to the modelview matrix and render some cubes with shadows and other things.
Where is the problem? Once i call glDrawPixels(), the back buffer should be filled with the right pixels. After this, i donât call any glClear(GL_COLOR_BUFFER_BIT), so i am a bit confusedâŚ
Any idea?
Thanks a lot,
Luca