summaryrefslogtreecommitdiff
path: root/src/Fl_Gl_Choice.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl_Gl_Choice.cxx')
-rw-r--r--src/Fl_Gl_Choice.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Fl_Gl_Choice.cxx b/src/Fl_Gl_Choice.cxx
index 88ed16d1c..75fc9dea8 100644
--- a/src/Fl_Gl_Choice.cxx
+++ b/src/Fl_Gl_Choice.cxx
@@ -315,11 +315,15 @@ GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int lay
aglEnable( (GLContext)context, AGL_BUFFER_RECT );
}
#if defined(__APPLE_COCOA__)
+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
- aglSetWindowRef(context, MACwindowRef(window) );
-#else
- aglSetDrawable( context, GetWindowPort( MACwindowRef(window) ) );
+ if (aglSetWindowRef != NULL) {
+ aglSetWindowRef(context, MACwindowRef(window) );
+ }
+ else
#endif
+ aglSetDrawable( context, GetWindowPort( MACwindowRef(window) ) );
+
#else
aglSetDrawable( context, GetWindowPort( fl_xid(window) ) );
#endif