Clean up CInterfaceAGL, make sure the screen gets cleared on stop, and remove the FPS update that messes up GUI builds since GUIless doesn't build anyways.

This commit is contained in:
Braden 2013-03-18 17:15:59 -05:00
parent 7d74293170
commit a2af6494cf
2 changed files with 3 additions and 29 deletions

View File

@ -31,12 +31,6 @@ void cInterfaceAGL::Swap()
[GLWin.cocoaCtx flushBuffer];
}
// Show the current FPS
void cInterfaceAGL::UpdateFPSDisplay(const char *text)
{
}
// Create rendering window.
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
bool cInterfaceAGL::Create(void *&window_handle)
@ -48,8 +42,6 @@ bool cInterfaceAGL::Create(void *&window_handle)
s_backbuffer_width = _twidth;
s_backbuffer_height = _theight;
NSRect size;
NSUInteger style = NSMiniaturizableWindowMask;
NSOpenGLPixelFormatAttribute attr[] = { NSOpenGLPFADoubleBuffer, NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, NSOpenGLPFAAccelerated, 0 };
NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc]
initWithAttributes: attr];
@ -66,13 +58,6 @@ bool cInterfaceAGL::Create(void *&window_handle)
return NULL;
}
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen) {
size = [[NSScreen mainScreen] frame];
style |= NSBorderlessWindowMask;
} else {
size = NSMakeRect(_tx, _ty, _twidth, _theight);
style |= NSResizableWindowMask | NSTitledWindowMask;
}
GLWin.cocoaWin = (NSView*)(((wxPanel*)window_handle)->GetHandle());;
if (GLWin.cocoaWin == nil) {
@ -89,18 +74,7 @@ bool cInterfaceAGL::Create(void *&window_handle)
bool cInterfaceAGL::MakeCurrent()
{
int width, height;
width = [GLWin.cocoaWin frame].size.width;
height = [GLWin.cocoaWin frame].size.height;
//if (width == s_backbuffer_width && height == s_backbuffer_height)
// return true;
[GLWin.cocoaCtx setView: GLWin.cocoaWin];
[GLWin.cocoaCtx update];
[GLWin.cocoaCtx makeCurrentContext];
s_backbuffer_width = width;
s_backbuffer_height = height;
return true;
}
@ -109,6 +83,7 @@ void cInterfaceAGL::Shutdown()
{
[GLWin.cocoaCtx clearDrawable];
[GLWin.cocoaCtx release];
GLWin.cocoaCtx = nil;
}
void cInterfaceAGL::Update()

View File

@ -28,7 +28,6 @@ class cInterfaceAGL : public cInterfaceBase
{
public:
void Swap();
void UpdateFPSDisplay(const char *Text);
bool Create(void *&window_handle);
bool MakeCurrent();
void Shutdown();