Deal with some clang-inspired buglets.

Respect the initial fullscreen setting in nowx.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7089 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2011-02-06 01:56:45 +00:00
parent 35edf1b236
commit 0f7ff9c23e
9 changed files with 284 additions and 256 deletions

View File

@ -338,6 +338,8 @@ bool OpenGL_Create(int _iwidth, int _iheight)
GLWin.glCtxt = new wxGLContext(GLWin.glCanvas);
#elif defined(__APPLE__)
NSRect size;
NSUInteger style = NSMiniaturizableWindowMask;
NSOpenGLPixelFormatAttribute attr[2] = { NSOpenGLPFADoubleBuffer, 0 };
NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc]
initWithAttributes: attr];
@ -354,15 +356,29 @@ bool OpenGL_Create(int _iwidth, int _iheight)
return NULL;
}
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen) {
size = [[NSScreen mainScreen] frame];
style |= NSBorderlessWindowMask;
} else {
size = NSMakeRect(_tx, _ty, _twidth, _theight);
style |= NSResizableWindowMask | NSTitledWindowMask;
}
(void)VideoWindowHandle;
CGDisplayCapture(CGMainDisplayID());
GLWin.cocoaWin = [[NSWindow alloc]
initWithContentRect: [[NSScreen mainScreen] frame]
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered defer: NO];
[GLWin.cocoaWin makeKeyAndOrderFront: nil];
[GLWin.cocoaWin setLevel: CGShieldingWindowLevel()];
GLWin.cocoaWin = [[NSWindow alloc] initWithContentRect: size
styleMask: style backing: NSBackingStoreBuffered defer: NO];
if (GLWin.cocoaWin == nil) {
ERROR_LOG(VIDEO, "failed to create window");
return NULL;
}
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen) {
CGDisplayCapture(CGMainDisplayID());
[GLWin.cocoaWin setLevel: CGShieldingWindowLevel()];
}
[GLWin.cocoaCtx setView: [GLWin.cocoaWin contentView]];
[GLWin.cocoaWin makeKeyAndOrderFront: nil];
#elif defined(_WIN32)
VideoWindowHandle() = (void*)EmuWindow::Create((HWND)VideoWindowHandle(), GetModuleHandle(0), _T("Please wait..."));