Fixed OpenGL overlay drawing (STR #2437).

Back-ported the corresponding patch for FLTK 1.3.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@8077 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2010-12-20 14:48:38 +00:00
parent d54fb3f925
commit cace309838
2 changed files with 10 additions and 5 deletions

View File

@ -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)

View File

@ -285,10 +285,7 @@ void Fl_Gl_Window::flush() {
glDrawBuffer(GL_BACK);
if (!SWAP_TYPE) {
#ifdef __APPLE_QD__
SWAP_TYPE = COPY;
#elif defined __APPLE_QUARTZ__
// warning: the Quartz version should probably use Core GL (CGL) instead of AGL
#if !defined(WIN32) // __APPLE__ || X11
SWAP_TYPE = COPY;
#else
SWAP_TYPE = UNDEFINED;
@ -298,6 +295,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;
}
}
@ -314,6 +312,12 @@ void Fl_Gl_Window::flush() {
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 @@ 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);