diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Gl_Choice.cxx | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/Fl_Gl_Choice.cxx b/src/Fl_Gl_Choice.cxx index 7d3a238ab..7dd4bc947 100644 --- a/src/Fl_Gl_Choice.cxx +++ b/src/Fl_Gl_Choice.cxx @@ -349,11 +349,21 @@ void fl_set_gl_context(Fl_Window* w, GLContext context) { aglSetInteger( context, AGL_BUFFER_RECT, rect ); aglEnable( context, AGL_BUFFER_RECT ); } -# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - aglSetWindowRef(context, MACwindowRef(w) ); -# else - aglSetDrawable( context, GetWindowPort( MACwindowRef(w) ) ); -# endif +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if __LP64__ + // 64 bit version + aglSetWindowRef(context, MACwindowRef(w) ); +#else + // 32 bit version >= 10.5 + if (aglSetWindowRef != NULL) + aglSetWindowRef(context, MACwindowRef(w) ); + else + aglSetDrawable( context, GetWindowPort( MACwindowRef(w) ) ); +#endif +#else + // 32 bit version < 10.5 + aglSetDrawable( context, GetWindowPort( MACwindowRef(w) ) ); +#endif aglSetCurrentContext(context); # else # error unsupported platform @@ -370,12 +380,13 @@ void fl_no_gl_context() { wglMakeCurrent(0, 0); # elif defined(__APPLE_QUARTZ__) // warning: the Quartz version should probably use Core GL (CGL) instead of AGL - AGLContext ctx = aglGetCurrentContext(); -# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - if (ctx) aglSetWindowRef(ctx, NULL); -# else - if (ctx) aglSetDrawable(ctx, NULL); -# endif + AGLContext ctx = aglGetCurrentContext(); +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + if (aglSetWindowRef != NULL) + { if(ctx) aglSetWindowRef(ctx, NULL ); } + else +#endif + if(ctx) aglSetDrawable( ctx, NULL ); aglSetCurrentContext(0); # else # error unsupported platform |
