diff options
| author | Fabien Costantini <fabien@onepost.net> | 2008-10-13 23:10:43 +0000 |
|---|---|---|
| committer | Fabien Costantini <fabien@onepost.net> | 2008-10-13 23:10:43 +0000 |
| commit | 92051890f1127429142cc0b60e3e9a1e567bf01d (patch) | |
| tree | 4c0e7f28192914b24202d08aa3eaa72a7bf5f7e4 /src/Fl_Gl_Window.cxx | |
| parent | 8e9c1d1ab030dc7beed522f368c467dd94e1f8bb (diff) | |
Quickdraw removal: option removed from configure, all Qd code removed from sources. Also took this opportunity to sort the ifdef clauses so that USE_X11 shows first. Also added error pragma to enforce proper target checking, thus make even less assumptions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6423 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Gl_Window.cxx')
| -rw-r--r-- | src/Fl_Gl_Window.cxx | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index a6757a2ce..db6fe011d 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -122,22 +122,23 @@ int Fl_Gl_Window::mode(int m, const int *a) { mode_ = m; alist = a; if (shown()) { g = Fl_Gl_Choice::find(m, a); -#if defined(WIN32) + +#if defined(USE_X11) + // under X, if the visual changes we must make a new X window (yuck!): + if (!g || g->vis->visualid!=oldg->vis->visualid || (oldmode^m)&FL_DOUBLE) { + hide(); + show(); + } +#elif defined(WIN32) if (!g || (oldmode^m)&(FL_DOUBLE|FL_STEREO)) { hide(); show(); } -#elif defined(__APPLE_QD__) - redraw(); #elif defined(__APPLE_QUARTZ__) // warning: the Quartz version should probably use Core GL (CGL) instead of AGL redraw(); #else - // under X, if the visual changes we must make a new X window (yuck!): - if (!g || g->vis->visualid!=oldg->vis->visualid || (oldmode^m)&FL_DOUBLE) { - hide(); - show(); - } +# error unsupported platform #endif } else { g = 0; @@ -224,7 +225,9 @@ void Fl_Gl_Window::ortho() { It is called automatically after the draw() method is called. */ void Fl_Gl_Window::swap_buffers() { -#ifdef WIN32 +#if defined(USE_X11) + glXSwapBuffers(fl_display, fl_xid(this)); +#elif defined(WIN32) # if HAVE_GL_OVERLAY // Do not swap the overlay, to match GLX: BOOL ret = wglSwapLayerBuffers(Fl_X::i(this)->private_dc, WGL_SWAP_MAIN_PLANE); @@ -232,13 +235,11 @@ void Fl_Gl_Window::swap_buffers() { # else SwapBuffers(Fl_X::i(this)->private_dc); # endif -#elif defined(__APPLE_QD__) - aglSwapBuffers((AGLContext)context_); #elif defined(__APPLE_QUARTZ__) // warning: the Quartz version should probably use Core GL (CGL) instead of AGL aglSwapBuffers((AGLContext)context_); #else - glXSwapBuffers(fl_display, fl_xid(this)); +# error unsupported platform #endif } @@ -253,15 +254,7 @@ void Fl_Gl_Window::flush() { uchar save_valid_f = valid_f_; #endif -#ifdef __APPLE_QD__ - //: clear previous clipping in this shared port - GrafPtr port = GetWindowPort( fl_xid(this) ); - Rect rect; SetRect( &rect, 0, 0, 0x7fff, 0x7fff ); - GrafPtr old; GetPort( &old ); - SetPort( port ); - ClipRect( &rect ); - SetPort( old ); -#elif defined(__APPLE_QUARTZ__) +#if defined(__APPLE_QUARTZ__) // warning: the Quartz version should probably use Core GL (CGL) instead of AGL //: clear previous clipping in this shared port GrafPtr port = GetWindowPort( fl_xid(this) ); @@ -309,9 +302,7 @@ void Fl_Gl_Window::flush() { glDrawBuffer(GL_BACK); if (!SWAP_TYPE) { -#ifdef __APPLE_QD__ - SWAP_TYPE = COPY; -#elif defined __APPLE_QUARTZ__ +#if defined __APPLE_QUARTZ__ // warning: the Quartz version should probably use Core GL (CGL) instead of AGL SWAP_TYPE = COPY; #else |
