why use glClear: The framework I was setting up seemed to make sense if I used glClear. I thought passing zero would be just as good as not calling it. You’re right that I basically want alpha blended stuff showing which doesn’t require depth testing.
I’ve been able to see some results. I think I was drawing in a window area that had dimensions of 0x0. Oops. Now I’m able to clear the whole screen if I choose, which is a good sign for now. So, because of the brilliant hooking code, I am eliminating all calls to SwapWindows until the final call to it is needed and this is giving me nice results, no tearing or flicker. My issue with SwapBuffer seems to be solved, but I have another (related) problem…
Now that I’m drawing after the other engine is drawing, the content of what the other engine is drawing is affected. Some sections of the terrain (its a flight sim) are transparent, and the skydome has similar problems. I am making an attempt to return any state changes back to their original values after I render, but I have made sure only a small number of states have changed and I’m drawing only vertex positions in immediate mode in my engine. I’m using a very small number of calls, glClearColor, glClear, glScissor, glViewport, glMatrixMode, glLoadIdentity, gluPerspective, gluLookAt, glPushMatrix, glTranslatef, glBegin, glVertex3f, glEnd, glPopMatrix.
I also tried using the OGRE engine instead of my engine as the engine to render after the flight sim. The same sections of the terrain that are missing from the flight sim are actually not missing when using OGRE, but they are much brighter in color, almost white. I’m pretty sure the dis-coloration is not from lighting, I’m pretty sure there are no lights in the flight sim, and I know there are no light states managed by the 2nd engine rendering over the flight sim. I guess I should check to see if Ogre enabled GL_LIGHTING, but I know my custom engine is not doing that (which has the missing polygons effect).
Why might some polygons have brighter colored textures or be completely missing when trying to draw over the results of another engine? Many thanks!