glReadPixels and Win2000

Hi, while using win98, I used the following line to read the Zbuffer at the mouse coordinates:

glReadPixels(mousex,mousey,1,1,GL_DEPTH_COMPONENT,GL_UNSIGNED_SHORT,point);

It worked fine …
Now I use Win2000 with the latest G400 drivers, and something strange happens…
The doublebuffering is broken, that is one frame is the FIRST frame ever rendered and the other frame is the actual frame… Very psychedelic!

One question… WHY ???

My G200 OpenGL programs flickered the screen to death in Win2k fullscreen. Use Win98 until they fix the drivers/windows

Here is what I discovered; when running on a Matrox card, you can get rid of the psychedlic spazziness by calling wglMakeCurrent() with your current render & device contexts prior to your call to SwapBuffers(). In my game I wrapped the call to SwapBuffers(), and so on Matrox hardware I use a special swapping function that calls wglMakeCurrent() before the call to SwapBuffers() - since calling wglMakeCurrent() prior to SwapBuffers() broke on other cards. ::sigh::

Originally posted by Pauly:
My G200 OpenGL programs flickered the screen to death in Win2k fullscreen. Use Win98 until they fix the drivers/windows

This happens to me only if I use glReadPixels.
If I comment it out the program runs well…

Is there another way to read the Zbuffer ?

[This message has been edited by Andrea Doimo (edited 11-14-2000).]

Originally posted by DJ Tricky S:
I use a special swapping function that calls wglMakeCurrent() before the call to SwapBuffers() - since calling wglMakeCurrent() prior to SwapBuffers() broke on other cards. ::sigh::

It works… Can you explain how you fixed the problem with the other cards? What does your “special swapping function”?

Thanks