Author: yuri
Date: 2010-12-13 11:48:47 -0800 (Mon, 13 Dec 2010)
New Revision: 8026
Log:
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.
Modified:
branches/branch-1.3/src/Fl_Gl_Window.cxx
Modified: branches/branch-1.3/src/Fl_Gl_Window.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Gl_Window.cxx 2010-12-13 18:04:35 UTC (rev
8025)
+++ branches/branch-1.3/src/Fl_Gl_Window.cxx 2010-12-13 19:48:47 UTC (rev
8026)
@@ -324,7 +324,7 @@
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 @@
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 @@
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 @@
}
- 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);
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit