Author: AlbrechtS
Date: 2010-12-20 06:48:38 -0800 (Mon, 20 Dec 2010)
New Revision: 8077
Log:
Fixed OpenGL overlay drawing (STR #2437).
Back-ported the corresponding patch for FLTK 1.3.


Modified:
   branches/branch-1.1/CHANGES
   branches/branch-1.1/src/Fl_Gl_Window.cxx

Modified: branches/branch-1.1/CHANGES
===================================================================
--- branches/branch-1.1/CHANGES 2010-12-20 13:59:09 UTC (rev 8076)
+++ branches/branch-1.1/CHANGES 2010-12-20 14:48:38 UTC (rev 8077)
@@ -1,5 +1,6 @@
 CHANGES IN FLTK 1.1.11
 
+       - Fixed OpenGL overlay drawing (STR #2437)
        - Fixed Fl_Tabs selection border drawing, if tabs are at the bottom
          of the widget (part of STR #2480)
        - Documentation fixes (STR #2410)

Modified: branches/branch-1.1/src/Fl_Gl_Window.cxx
===================================================================
--- branches/branch-1.1/src/Fl_Gl_Window.cxx    2010-12-20 13:59:09 UTC (rev 
8076)
+++ branches/branch-1.1/src/Fl_Gl_Window.cxx    2010-12-20 14:48:38 UTC (rev 
8077)
@@ -285,11 +285,8 @@
     glDrawBuffer(GL_BACK);
 
     if (!SWAP_TYPE) {
-#ifdef __APPLE_QD__
+#if !defined(WIN32) // __APPLE__ || X11
       SWAP_TYPE = COPY;
-#elif defined __APPLE_QUARTZ__
-      // warning: the Quartz version should probably use Core GL (CGL) instead 
of AGL
-      SWAP_TYPE = COPY;
 #else
       SWAP_TYPE = UNDEFINED;
 #endif
@@ -298,6 +295,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;
       }
     }
 
@@ -314,6 +312,12 @@
       if (damage() != FL_DAMAGE_OVERLAY || !save_valid) draw();
       swap_buffers();
 
+    } else if (SWAP_TYPE == SWAP) {
+      damage(FL_DAMAGE_ALL);
+      draw();
+      if (overlay == this) draw_overlay();
+      swap_buffers();
+
     } else { // SWAP_TYPE == UNDEFINED
 
       // If we are faking the overlay, use CopyPixels to act like
@@ -350,7 +354,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

Reply via email to