summaryrefslogtreecommitdiffstats
path: root/src/glut/glx/glut_swap.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>1999-08-19 13:57:42 +0000
committerBrian Paul <[email protected]>1999-08-19 13:57:42 +0000
commita4dcdcf0ffae4c6cf52354fbd63c95d7d7815fd9 (patch)
treef4c57aa74226a59913cb650b87f7083eee5e34b6 /src/glut/glx/glut_swap.c
parent2d550f6ff1afa3189874c99cfe4125362ee76797 (diff)
initial check-in (post crash)
Diffstat (limited to 'src/glut/glx/glut_swap.c')
-rw-r--r--src/glut/glx/glut_swap.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/glut/glx/glut_swap.c b/src/glut/glx/glut_swap.c
new file mode 100644
index 00000000000..0864e58d429
--- /dev/null
+++ b/src/glut/glx/glut_swap.c
@@ -0,0 +1,47 @@
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
+
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
+ implied. This program is -not- in the public domain. */
+
+#include "glutint.h"
+
+/* CENTRY */
+void APIENTRY
+glutSwapBuffers(void)
+{
+ GLUTwindow *window = __glutCurrentWindow;
+
+ if (window->renderWin == window->win) {
+ if (__glutCurrentWindow->treatAsSingle) {
+ /* Pretend the double buffered window is single buffered,
+ so treat glutSwapBuffers as a no-op. */
+ return;
+ }
+ } else {
+ if (__glutCurrentWindow->overlay->treatAsSingle) {
+ /* Pretend the double buffered overlay is single
+ buffered, so treat glutSwapBuffers as a no-op. */
+ return;
+ }
+ }
+
+ /* For the MESA_SWAP_HACK. */
+ window->usedSwapBuffers = 1;
+
+ SWAP_BUFFERS_LAYER(__glutCurrentWindow);
+
+ /* I considered putting the window being swapped on the
+ GLUT_FINISH_WORK work list because you could call
+ glutSwapBuffers from an idle callback which doesn't call
+ __glutSetWindow which normally adds indirect rendering
+ windows to the GLUT_FINISH_WORK work list. Not being put
+ on the list could lead to the buffering up of multiple
+ redisplays and buffer swaps and hamper interactivity. I
+ consider this an application bug due to not using
+ glutPostRedisplay to trigger redraws. If
+ glutPostRedisplay were used, __glutSetWindow would be
+ called and a glFinish to throttle buffering would occur. */
+}
+/* ENDCENTRY */