Hi,
I have a program using OpenGL which works fine under WinXP. But it has some problems running under Vista when I do the trimming with SwapBuffers function. Who can help me about this and tell me how to use SwapBuffers under Vista?
The part of source code as below.
[b] WaitForSingleObject( TheDisplaySemaphoreHandle, INFINITE );
US_wglMakeCurrent( theView3DPtr->View3DHdc,
theView3DPtr->View3DHglrc );
glFlush();
glFinish();
SwapBuffers( View3DHdc );
glDrawBuffer (GL_FRONT );
glDisable ( GL_DEPTH_TEST );
glDepthMask ( False );
glPointSize (5.);
myPointListPtr = thePointsListPtr;
glColor4fv (TheOpenGLRedMaterial);
//red points for user
glBegin(GL_POINTS);
AT_ResetObjectList ( thePointsListPtr );
while( !AT_EndOfObjectList ( thePointsListPtr ) )
{
myPointPtr = (RealCoordinatePtr) AT_ReadObjectAndGo(
thePointsListPtr );
glVertex3f ( myPointPtr->x, myPointPtr->y, myPointPtr->z );
}
glEnd();
//red edge for splined
AT_ResetObjectList ( myTempDisplayListPtr );
my1stPointPtr = (RealCoordinatePtr) AT_ReadObjectAndGo (
myTempDisplayListPtr );
while( !AT_EndOfObjectList ( myTempDisplayListPtr ) )
{
my2ndPointPtr = (RealCoordinatePtr) AT_ReadObjectAndGo (
myTempDisplayListPtr );
glBegin(GL_LINES);
glVertex3f ( my1stPointPtr->x, my1stPointPtr->y,
my1stPointPtr->z );
glVertex3f ( my2ndPointPtr->x, my2ndPointPtr->y,
my2ndPointPtr->z );
glEnd();
my1stPointPtr=my2ndPointPtr;
}
glDrawBuffer (GL_BACK );
glEnable ( GL_DEPTH_TEST );
glDepthMask ( True );
glPointSize (1.);
glLineWidth( 1.0f );
if( WaitForSingleObject ( TheDisplaySemaphoreHandle, 0 ) != 0 )
{
US_wglMakeCurrent( NULL, NULL );
ReleaseSemaphore ( TheDisplaySemaphoreHandle, 1, NULL );
}
[/b]
Thanks in advance.