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
This commit is contained in:
yuri 2010-12-13 19:48:47 +00:00
parent fbe0128869
commit 62487fbe23

View File

@ -324,7 +324,7 @@ void Fl_Gl_Window::flush() {
glDrawBuffer(GL_BACK); glDrawBuffer(GL_BACK);
if (!SWAP_TYPE) { if (!SWAP_TYPE) {
#if defined (__APPLE_QUARTZ__) #if defined (__APPLE_QUARTZ__) || defined (__linux__)
SWAP_TYPE = COPY; SWAP_TYPE = COPY;
#else #else
SWAP_TYPE = UNDEFINED; SWAP_TYPE = UNDEFINED;
@ -334,6 +334,7 @@ void Fl_Gl_Window::flush() {
if (!strcmp(c,"COPY")) SWAP_TYPE = COPY; if (!strcmp(c,"COPY")) SWAP_TYPE = COPY;
else if (!strcmp(c, "NODAMAGE")) SWAP_TYPE = NODAMAGE; else if (!strcmp(c, "NODAMAGE")) SWAP_TYPE = NODAMAGE;
else if (!strcmp(c, "SWAP")) SWAP_TYPE = SWAP; 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(); if (damage() != FL_DAMAGE_OVERLAY || !save_valid) draw();
swap_buffers(); 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 // If we are faking the overlay, use CopyPixels to act like
// SWAP_TYPE == COPY. Otherwise overlay redraw is way too slow. // 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); glDrawBuffer(GL_FRONT);
draw_overlay(); draw_overlay();
glDrawBuffer(GL_BACK); glDrawBuffer(GL_BACK);