Single buffered rendering for Windows.

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@60 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dheyse 2003-06-12 18:52:37 +00:00
parent a4bfe34a9e
commit c543d287c1
3 changed files with 17 additions and 16 deletions

View File

@ -74,12 +74,12 @@ void FGAPIENTRY glutSwapBuffers( void )
*/
glFlush();
#if TARGET_HOST_UNIX_X11
/*
* If it's single-buffered, we shouldn't be here.
*/
if ( ! fgStructure.Window->Window.DoubleBuffered ) return ;
#if TARGET_HOST_UNIX_X11
/*
* Issue the glXSwapBuffers call and be done with it
*/

View File

@ -291,7 +291,6 @@ struct tagSFG_Context
Window Handle; /* The window's handle */
GLXContext Context; /* The OpenGL context */
XVisualInfo* VisualInfo; /* The window's visual information */
int DoubleBuffered; /* Treat the window as double-buffered */
#elif TARGET_HOST_WIN32
HWND Handle; /* The window's handle */
@ -299,6 +298,8 @@ struct tagSFG_Context
HGLRC Context; /* The window's WGL context */
#endif
int DoubleBuffered; /* Treat the window as double-buffered */
};
/*

View File

@ -360,11 +360,6 @@ void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, i
freeglut_assert_ready;
/*
* Save the window's single- or double-buffering state
*/
window->Window.DoubleBuffered = ( fgState.DisplayMode & GLUT_DOUBLE ) ? 1 : 0 ;
/*
* Here we are upon the stage. Have the visual selected.
*/
@ -541,15 +536,6 @@ void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, i
# endif
}
/*
* If it's not double-buffered, make sure the rendering is done to the front buffer.
*/
if ( ! window->Window.DoubleBuffered )
{
glDrawBuffer ( GL_FRONT ) ;
glReadBuffer ( GL_FRONT ) ;
}
#elif TARGET_HOST_WIN32
WNDCLASS wc;
@ -636,6 +622,20 @@ void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, i
#endif
/*
* Save the window's single- or double-buffering state
*/
window->Window.DoubleBuffered = ( fgState.DisplayMode & GLUT_DOUBLE ) ? 1 : 0 ;
/*
* If it's not double-buffered, make sure the rendering is done to the front buffer.
*/
if ( ! window->Window.DoubleBuffered )
{
glDrawBuffer ( GL_FRONT ) ;
glReadBuffer ( GL_FRONT ) ;
}
/*
* Set the newly created window as the current one
*/