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:
parent
a4bfe34a9e
commit
c543d287c1
@ -74,12 +74,12 @@ void FGAPIENTRY glutSwapBuffers( void )
|
|||||||
*/
|
*/
|
||||||
glFlush();
|
glFlush();
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
|
||||||
/*
|
/*
|
||||||
* If it's single-buffered, we shouldn't be here.
|
* If it's single-buffered, we shouldn't be here.
|
||||||
*/
|
*/
|
||||||
if ( ! fgStructure.Window->Window.DoubleBuffered ) return ;
|
if ( ! fgStructure.Window->Window.DoubleBuffered ) return ;
|
||||||
|
|
||||||
|
#if TARGET_HOST_UNIX_X11
|
||||||
/*
|
/*
|
||||||
* Issue the glXSwapBuffers call and be done with it
|
* Issue the glXSwapBuffers call and be done with it
|
||||||
*/
|
*/
|
||||||
|
@ -291,7 +291,6 @@ struct tagSFG_Context
|
|||||||
Window Handle; /* The window's handle */
|
Window Handle; /* The window's handle */
|
||||||
GLXContext Context; /* The OpenGL context */
|
GLXContext Context; /* The OpenGL context */
|
||||||
XVisualInfo* VisualInfo; /* The window's visual information */
|
XVisualInfo* VisualInfo; /* The window's visual information */
|
||||||
int DoubleBuffered; /* Treat the window as double-buffered */
|
|
||||||
|
|
||||||
#elif TARGET_HOST_WIN32
|
#elif TARGET_HOST_WIN32
|
||||||
HWND Handle; /* The window's handle */
|
HWND Handle; /* The window's handle */
|
||||||
@ -299,6 +298,8 @@ struct tagSFG_Context
|
|||||||
HGLRC Context; /* The window's WGL context */
|
HGLRC Context; /* The window's WGL context */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int DoubleBuffered; /* Treat the window as double-buffered */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -360,11 +360,6 @@ void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, i
|
|||||||
|
|
||||||
freeglut_assert_ready;
|
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.
|
* 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
|
# 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
|
#elif TARGET_HOST_WIN32
|
||||||
|
|
||||||
WNDCLASS wc;
|
WNDCLASS wc;
|
||||||
@ -636,6 +622,20 @@ void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, i
|
|||||||
|
|
||||||
#endif
|
#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
|
* Set the newly created window as the current one
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user