summaryrefslogtreecommitdiff
path: root/src/Fl_Gl_Choice.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2010-03-29 10:35:00 +0000
committerMatthias Melcher <fltk@matthiasm.com>2010-03-29 10:35:00 +0000
commit941901e273319ce152523af7fa079a6f5cf89d68 (patch)
tree9d70b82fa54d81607a0022f14a0518c47805a796 /src/Fl_Gl_Choice.cxx
parentb77071a3de3593ea482aa7ea0a442c7fc888a2e2 (diff)
OS X: removed all Carbon and Quickdraw references. Starting with 1.3, we only support Cocoa and Quartz.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7351 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Gl_Choice.cxx')
-rw-r--r--src/Fl_Gl_Choice.cxx40
1 files changed, 9 insertions, 31 deletions
diff --git a/src/Fl_Gl_Choice.cxx b/src/Fl_Gl_Choice.cxx
index 479146ed7..7d3a238ab 100644
--- a/src/Fl_Gl_Choice.cxx
+++ b/src/Fl_Gl_Choice.cxx
@@ -304,19 +304,11 @@ GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int lay
if (!context) return 0;
add_context((GLContext)context);
if ( window->parent() ) {
-#ifdef __APPLE_COCOA__
- int H = window->window()->h();
- GLint rect[] = { window->x(), H-window->h()-window->y(), window->w(), window->h() };
-#else
- Rect wrect;
- GetWindowPortBounds( fl_xid(window), &wrect );
- GLint rect[] = { window->x(), wrect.bottom-window->h()-window->y(), window->w(), window->h() };
-#endif
- aglSetInteger( (GLContext)context, AGL_BUFFER_RECT, rect );
- aglEnable( (GLContext)context, AGL_BUFFER_RECT );
+ int H = window->window()->h();
+ GLint rect[] = { window->x(), H-window->h()-window->y(), window->w(), window->h() };
+ aglSetInteger( (GLContext)context, AGL_BUFFER_RECT, rect );
+ aglEnable( (GLContext)context, AGL_BUFFER_RECT );
}
-#if defined(__APPLE_COCOA__)
-
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
#if __LP64__
// 64 bit version
@@ -332,10 +324,6 @@ GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int lay
// 32 bit version < 10.5
aglSetDrawable( context, GetWindowPort( MACwindowRef(window) ) );
#endif
-
-#else
- aglSetDrawable( context, GetWindowPort( fl_xid(window) ) );
-#endif
return (context);
}
# else
@@ -356,26 +344,16 @@ void fl_set_gl_context(Fl_Window* w, GLContext context) {
# elif defined(__APPLE_QUARTZ__)
// warning: the Quartz version should probably use Core GL (CGL) instead of AGL
if ( w->parent() ) { //: resize our GL buffer rectangle
-#ifdef __APPLE_COCOA__
- int H = w->window()->h();
- GLint rect[] = { w->x(), H-w->h()-w->y(), w->w(), w->h() };
-#else
- Rect wrect;
- GetWindowPortBounds( fl_xid(w), &wrect );
- GLint rect[] = { w->x(), wrect.bottom-w->h()-w->y(), w->w(), w->h() };
-#endif
+ int H = w->window()->h();
+ GLint rect[] = { w->x(), H-w->h()-w->y(), w->w(), w->h() };
aglSetInteger( context, AGL_BUFFER_RECT, rect );
aglEnable( context, AGL_BUFFER_RECT );
}
-#if defined(__APPLE_COCOA__)
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
aglSetWindowRef(context, MACwindowRef(w) );
-#else
+# else
aglSetDrawable( context, GetWindowPort( MACwindowRef(w) ) );
-#endif
-#else
- aglSetDrawable( context, GetWindowPort( fl_xid(w) ) );
-#endif
+# endif
aglSetCurrentContext(context);
# else
# error unsupported platform