Skip to content
This repository has been archived by the owner on Sep 30, 2018. It is now read-only.

Commit

Permalink
[osx] fixed, non-accelerated renderer fallback was not working. Need …
Browse files Browse the repository at this point in the history
…to check created context and not created pixel format
  • Loading branch information
davilla committed Feb 15, 2011
1 parent 5eaa9f0 commit b9990a4
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions xbmc/windowing/osx/WinSystemOSX.mm
Expand Up @@ -630,6 +630,8 @@ void DisplayFadeFromBlack(CGDisplayFadeReservationToken fade_token)

void* CWinSystemOSX::CreateWindowedContext(void* shareCtx)
{
NSOpenGLContext* newContext = NULL;

NSOpenGLPixelFormatAttribute wattrs[] =
{
NSOpenGLPFADoubleBuffer,
Expand All @@ -639,9 +641,14 @@ void DisplayFadeFromBlack(CGDisplayFadeReservationToken fade_token)
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[] =
Expand All @@ -653,13 +660,11 @@ void DisplayFadeFromBlack(CGDisplayFadeReservationToken fade_token)
(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;
}
Expand Down

0 comments on commit b9990a4

Please sign in to comment.