Does not blink the OpenGl cursor on NT except when a gl overlay is being done, should make display faster when a cursor is set

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1482 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Bill Spitzak 2001-07-18 08:11:02 +00:00
parent da83aa4eb4
commit 8060de2f30
1 changed files with 11 additions and 10 deletions

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Gl_Window.cxx,v 1.12.2.21 2001/03/14 17:20:01 spitzak Exp $" // "$Id: Fl_Gl_Window.cxx,v 1.12.2.22 2001/07/18 08:11:02 spitzak Exp $"
// //
// OpenGL window code for the Fast Light Tool Kit (FLTK). // OpenGL window code for the Fast Light Tool Kit (FLTK).
// //
@ -163,14 +163,16 @@ void Fl_Gl_Window::flush() {
#if HAVE_GL_OVERLAY && defined(WIN32) #if HAVE_GL_OVERLAY && defined(WIN32)
// SGI 320 messes up overlay with user-defined cursors: bool fixcursor = false; // for fixing the SGI 320 bug
bool fixcursor =
Fl_X::i(this)->cursor && Fl_X::i(this)->cursor != fl_default_cursor;
if (fixcursor) SetCursor(0);
// Draw into hardware overlay planes: // Draw into hardware overlay planes if they are damaged:
if (overlay && overlay != this if (overlay && overlay != this
&& (damage()&(FL_DAMAGE_OVERLAY|FL_DAMAGE_EXPOSE) || !save_valid)) { && (damage()&(FL_DAMAGE_OVERLAY|FL_DAMAGE_EXPOSE) || !save_valid)) {
// SGI 320 messes up overlay with user-defined cursors:
if (Fl_X::i(this)->cursor && Fl_X::i(this)->cursor != fl_default_cursor) {
fixcursor = true; // make it restore cursor later
SetCursor(0);
}
fl_set_gl_context(this, (GLContext)overlay); fl_set_gl_context(this, (GLContext)overlay);
if (fl_overlay_depth) if (fl_overlay_depth)
wglRealizeLayerPalette(Fl_X::i(this)->private_dc, 1, TRUE); wglRealizeLayerPalette(Fl_X::i(this)->private_dc, 1, TRUE);
@ -181,7 +183,8 @@ void Fl_Gl_Window::flush() {
fl_overlay = 0; fl_overlay = 0;
valid(save_valid); valid(save_valid);
wglSwapLayerBuffers(Fl_X::i(this)->private_dc, WGL_SWAP_OVERLAY1); wglSwapLayerBuffers(Fl_X::i(this)->private_dc, WGL_SWAP_OVERLAY1);
if (damage() == FL_DAMAGE_OVERLAY) { // main layer is undamaged // if only the overlay was damaged we are done, leave main layer alone:
if (damage() == FL_DAMAGE_OVERLAY) {
if (fixcursor) SetCursor(Fl_X::i(this)->cursor); if (fixcursor) SetCursor(Fl_X::i(this)->cursor);
return; return;
} }
@ -245,11 +248,9 @@ void Fl_Gl_Window::flush() {
damage1_ = 0; damage1_ = 0;
} else { } else {
damage1_ = damage(); damage1_ = damage();
clear_damage(~0); draw(); clear_damage(~0); draw();
swap_buffers(); swap_buffers();
} }
} }
@ -324,5 +325,5 @@ void Fl_Gl_Window::draw_overlay() {}
#endif #endif
// //
// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.21 2001/03/14 17:20:01 spitzak Exp $". // End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.22 2001/07/18 08:11:02 spitzak Exp $".
// //