- AGLDrawable drawable = (AGLDrawable)GetWindowPort(MAC_WXHWND(MacGetTopLevelWindowRef()));
- aglSetDrawable(m_dummyContext, drawable);
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ if ( UMAGetSystemVersion() >= 0x1050 )
+ {
+ aglSetWindowRef(m_dummyContext, MacGetTopLevelWindowRef());
+ }
+ else
+#endif
+ {
+ AGLDrawable drawable = (AGLDrawable)GetWindowPort(MAC_WXHWND(MacGetTopLevelWindowRef()));
+ aglSetDrawable(m_dummyContext, drawable);
+ }