first try of osx fix, mostly by pauldachz

This commit is contained in:
degasus
2013-02-07 10:34:29 +01:00
parent dae1226e1b
commit 376a807dea
8 changed files with 8 additions and 150 deletions

View File

@ -48,7 +48,7 @@ bool cInterfaceAGL::Create(void *&window_handle)
NSRect size;
NSUInteger style = NSMiniaturizableWindowMask;
NSOpenGLPixelFormatAttribute attr[2] = { NSOpenGLPFADoubleBuffer, 0 };
NSOpenGLPixelFormatAttribute attr[4] = { NSOpenGLPFADoubleBuffer, NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, 0 };
NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc]
initWithAttributes: attr];
if (fmt == nil) {
@ -57,7 +57,7 @@ bool cInterfaceAGL::Create(void *&window_handle)
}
GLWin.cocoaCtx = [[NSOpenGLContext alloc]
initWithFormat: fmt shareContext: nil kCGLPFAOpenGLProfile: kCGLOGLPVersion_3_2_Core ];
initWithFormat: fmt shareContext: nil];
[fmt release];
if (GLWin.cocoaCtx == nil) {
ERROR_LOG(VIDEO, "failed to create context");
@ -97,7 +97,7 @@ bool cInterfaceAGL::MakeCurrent()
width = [[GLWin.cocoaWin contentView] frame].size.width;
height = [[GLWin.cocoaWin contentView] frame].size.height;
if (width == s_backbuffer_width && height == s_backbuffer_height)
return;
return true;
[GLWin.cocoaCtx setView: [GLWin.cocoaWin contentView]];
[GLWin.cocoaCtx update];