diff --git a/apple/common/apple_gfx_context.c.inl b/apple/common/apple_gfx_context.c.inl index 00379d9858..b1ffe5ecc0 100644 --- a/apple/common/apple_gfx_context.c.inl +++ b/apple/common/apple_gfx_context.c.inl @@ -90,18 +90,30 @@ static bool apple_gfx_ctx_init(void *data) #ifdef OSX NSOpenGLPixelFormatAttribute attributes [] = { - NSOpenGLPFADoubleBuffer, // double buffered + NSOpenGLPFAColorSize, 24, + NSOpenGLPFADoubleBuffer, + NSOpenGLPFAAllowOfflineRenderers, NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute)16, // 16 bit depth buffer #ifdef MAC_OS_X_VERSION_10_7 (g_major || g_minor) ? NSOpenGLPFAOpenGLProfile : 0, (g_major << 12) | (g_minor << 8), #endif - (NSOpenGLPixelFormatAttribute)nil + (NSOpenGLPixelFormatAttribute)0 }; g_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes]; +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 + if (g_format == nil) + { + /* NSOpenGLFPAAllowOfflineRenderers is + not supported on this OS version. */ + attributes[3] = (NSOpenGLPixelFormatAttribute)0; + g_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes]; + } +#endif + if (g_use_hw_ctx) { //g_hw_ctx = [[NSOpenGLContext alloc] initWithFormat:g_format shareContext:nil];