summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryuri <yuri>2010-12-13 19:48:47 +0000
committeryuri <yuri>2010-12-13 19:48:47 +0000
commit62487fbe23c82e7b5679b0685f82c4e103a8b7a7 (patch)
treee1840ccf566d3b7f0b83751028785b544873feef
parentfbe01288699cf420e113077306027feefc1d3aaf (diff)
add missing SWAP GL_SWAP_TYPE overlay draw (the slowest)
change default to COPY for linux because UNDEFINED don't work and sometimes crash X with intel video cards. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8026 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_Gl_Window.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index 17cd1d3ea..8b0f17142 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -324,7 +324,7 @@ void Fl_Gl_Window::flush() {
glDrawBuffer(GL_BACK);
if (!SWAP_TYPE) {
-#if defined (__APPLE_QUARTZ__)
+#if defined (__APPLE_QUARTZ__) || defined (__linux__)
SWAP_TYPE = COPY;
#else
SWAP_TYPE = UNDEFINED;
@@ -334,6 +334,7 @@ void Fl_Gl_Window::flush() {
if (!strcmp(c,"COPY")) SWAP_TYPE = COPY;
else if (!strcmp(c, "NODAMAGE")) SWAP_TYPE = NODAMAGE;
else if (!strcmp(c, "SWAP")) SWAP_TYPE = SWAP;
+ else SWAP_TYPE = UNDEFINED;
}
}
@@ -350,7 +351,12 @@ void Fl_Gl_Window::flush() {
if (damage() != FL_DAMAGE_OVERLAY || !save_valid) draw();
swap_buffers();
- } else { // SWAP_TYPE == UNDEFINED
+ } else if (SWAP_TYPE == SWAP){
+ damage(FL_DAMAGE_ALL);
+ draw();
+ if (overlay == this) draw_overlay();
+ swap_buffers();
+ } else if (SWAP_TYPE == UNDEFINED){ // SWAP_TYPE == UNDEFINED
// If we are faking the overlay, use CopyPixels to act like
// SWAP_TYPE == COPY. Otherwise overlay redraw is way too slow.
@@ -386,7 +392,7 @@ void Fl_Gl_Window::flush() {
}
- if (overlay==this) { // fake overlay in front buffer
+ if (overlay==this && SWAP_TYPE != SWAP) { // fake overlay in front buffer
glDrawBuffer(GL_FRONT);
draw_overlay();
glDrawBuffer(GL_BACK);