void* CWinSystemOSX::CreateWindowedContext(void* shareCtx)
{
+ NSOpenGLContext* newContext = NULL;
+
NSOpenGLPixelFormatAttribute wattrs[] =
{
NSOpenGLPFADoubleBuffer,
NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute)8,
(NSOpenGLPixelFormatAttribute)0
};
-
+
NSOpenGLPixelFormat* pixFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:wattrs];
- if (!pixFmt)
+
+ newContext = [[NSOpenGLContext alloc] initWithFormat:(NSOpenGLPixelFormat*)pixFmt
+ shareContext:(NSOpenGLContext*)shareCtx];
+ [pixFmt release];
+
+ if (!newContext)
{
// bah, try again for non-accelerated renderer
NSOpenGLPixelFormatAttribute wattrs2[] =
(NSOpenGLPixelFormatAttribute)0
};
NSOpenGLPixelFormat* pixFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:wattrs2];
- if (!pixFmt)
- return nil;
+
+ newContext = [[NSOpenGLContext alloc] initWithFormat:(NSOpenGLPixelFormat*)pixFmt
+ shareContext:(NSOpenGLContext*)shareCtx];
+ [pixFmt release];
}
-
- NSOpenGLContext* newContext = [[NSOpenGLContext alloc] initWithFormat:(NSOpenGLPixelFormat*)pixFmt
- shareContext:(NSOpenGLContext*)shareCtx];
- [pixFmt release];
return newContext;
}