(OSX) Flesh out apple_gfx_ctx_init some more - add 'offline renderer'
flag, add fallback for pre-OSX 10.5, etc.
This commit is contained in:
parent
d87470c597
commit
9459749c79
|
@ -90,18 +90,30 @@ static bool apple_gfx_ctx_init(void *data)
|
||||||
#ifdef OSX
|
#ifdef OSX
|
||||||
|
|
||||||
NSOpenGLPixelFormatAttribute attributes [] = {
|
NSOpenGLPixelFormatAttribute attributes [] = {
|
||||||
NSOpenGLPFADoubleBuffer, // double buffered
|
NSOpenGLPFAColorSize, 24,
|
||||||
|
NSOpenGLPFADoubleBuffer,
|
||||||
|
NSOpenGLPFAAllowOfflineRenderers,
|
||||||
NSOpenGLPFADepthSize,
|
NSOpenGLPFADepthSize,
|
||||||
(NSOpenGLPixelFormatAttribute)16, // 16 bit depth buffer
|
(NSOpenGLPixelFormatAttribute)16, // 16 bit depth buffer
|
||||||
#ifdef MAC_OS_X_VERSION_10_7
|
#ifdef MAC_OS_X_VERSION_10_7
|
||||||
(g_major || g_minor) ? NSOpenGLPFAOpenGLProfile : 0,
|
(g_major || g_minor) ? NSOpenGLPFAOpenGLProfile : 0,
|
||||||
(g_major << 12) | (g_minor << 8),
|
(g_major << 12) | (g_minor << 8),
|
||||||
#endif
|
#endif
|
||||||
(NSOpenGLPixelFormatAttribute)nil
|
(NSOpenGLPixelFormatAttribute)0
|
||||||
};
|
};
|
||||||
|
|
||||||
g_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
|
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)
|
if (g_use_hw_ctx)
|
||||||
{
|
{
|
||||||
//g_hw_ctx = [[NSOpenGLContext alloc] initWithFormat:g_format shareContext:nil];
|
//g_hw_ctx = [[NSOpenGLContext alloc] initWithFormat:g_format shareContext:nil];
|
||||||
|
|
Loading…
Reference in New Issue