Fix full screen on OSX, well as fixed as its ever been. Apperently in render to main it always shown the FPS on the bottom in full screen.

This commit is contained in:
Braden 2013-03-17 20:58:43 -05:00
parent 8faefa3672
commit ae3c5a64cc
2 changed files with 17 additions and 7 deletions

View file

@ -34,7 +34,7 @@ void cInterfaceAGL::Swap()
// Show the current FPS
void cInterfaceAGL::UpdateFPSDisplay(const char *text)
{
[[GLWin.cocoaWin window] setTitle: [NSString stringWithUTF8String: text]];
}
// Create rendering window.
@ -80,11 +80,7 @@ bool cInterfaceAGL::Create(void *&window_handle)
return NULL;
}
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen) {
CGDisplayCapture(CGMainDisplayID());
[GLWin.cocoaWin setLevel: CGShieldingWindowLevel()];
}
[[GLWin.cocoaWin window] makeFirstResponder:GLWin.cocoaWin];
[GLWin.cocoaCtx setView: GLWin.cocoaWin];
[[GLWin.cocoaWin window] makeKeyAndOrderFront: nil];
@ -115,4 +111,16 @@ void cInterfaceAGL::Shutdown()
[GLWin.cocoaCtx release];
}
void cInterfaceAGL::Update()
{
if( s_backbuffer_width == [GLWin.cocoaWin frame].size.width
&& s_backbuffer_height == [GLWin.cocoaWin frame].size.height)
return;
s_backbuffer_width = [GLWin.cocoaWin frame].size.width;
s_backbuffer_height = [GLWin.cocoaWin frame].size.height;
[GLWin.cocoaCtx update];
}

View file

@ -31,7 +31,9 @@ public:
void UpdateFPSDisplay(const char *Text);
bool Create(void *&window_handle);
bool MakeCurrent();
void Shutdown();
void Shutdown();
void Update();
};
#endif