Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Clean up CInterfaceAGL, make sure the screen gets cleared on stop, an…
…d remove the FPS update that messes up GUI builds since GUIless doesn't build anyways.
  • Loading branch information
bzb95 committed Mar 18, 2013
1 parent 7d74293 commit a2af649
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 29 deletions.
31 changes: 3 additions & 28 deletions Source/Core/DolphinWX/Src/GLInterface/AGL.cpp
Expand Up @@ -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)
Expand All @@ -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];
Expand All @@ -66,14 +58,7 @@ 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) {
ERROR_LOG(VIDEO, "failed to create window");
Expand All @@ -89,26 +74,16 @@ 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;
return true;
}

// Close backend
void cInterfaceAGL::Shutdown()
{
[GLWin.cocoaCtx clearDrawable];
[GLWin.cocoaCtx release];
GLWin.cocoaCtx = nil;
}

void cInterfaceAGL::Update()
Expand Down
1 change: 0 additions & 1 deletion Source/Core/DolphinWX/Src/GLInterface/AGL.h
Expand Up @@ -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();
Expand Down

0 comments on commit a2af649

Please sign in to comment.