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 // Show the current FPS
void cInterfaceAGL::UpdateFPSDisplay(const char *text) void cInterfaceAGL::UpdateFPSDisplay(const char *text)
{ {
[[GLWin.cocoaWin window] setTitle: [NSString stringWithUTF8String: text]];
} }
// Create rendering window. // Create rendering window.
@ -80,11 +80,7 @@ bool cInterfaceAGL::Create(void *&window_handle)
return NULL; return NULL;
} }
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen) { [[GLWin.cocoaWin window] makeFirstResponder:GLWin.cocoaWin];
CGDisplayCapture(CGMainDisplayID());
[GLWin.cocoaWin setLevel: CGShieldingWindowLevel()];
}
[GLWin.cocoaCtx setView: GLWin.cocoaWin]; [GLWin.cocoaCtx setView: GLWin.cocoaWin];
[[GLWin.cocoaWin window] makeKeyAndOrderFront: nil]; [[GLWin.cocoaWin window] makeKeyAndOrderFront: nil];
@ -115,4 +111,16 @@ void cInterfaceAGL::Shutdown()
[GLWin.cocoaCtx release]; [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

@ -32,6 +32,8 @@ public:
bool Create(void *&window_handle); bool Create(void *&window_handle);
bool MakeCurrent(); bool MakeCurrent();
void Shutdown(); void Shutdown();
void Update();
}; };
#endif #endif