From a0fdcaced8de9a2628998f0c9e95762049e20ccc Mon Sep 17 00:00:00 2001 From: Braden Date: Wed, 13 Mar 2013 21:34:52 -0500 Subject: [PATCH] Removes the redundant window on OSX --- Source/Core/DolphinWX/Src/GLInterface.h | 2 +- Source/Core/DolphinWX/Src/GLInterface/AGL.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/Core/DolphinWX/Src/GLInterface.h b/Source/Core/DolphinWX/Src/GLInterface.h index 2db10b2dac..2923ff7bf4 100644 --- a/Source/Core/DolphinWX/Src/GLInterface.h +++ b/Source/Core/DolphinWX/Src/GLInterface.h @@ -50,7 +50,7 @@ typedef struct { int x, y; unsigned int width, height; #elif defined(__APPLE__) - NSWindow *cocoaWin; + NSView *cocoaWin; NSOpenGLContext *cocoaCtx; #elif defined(HAVE_X11) && HAVE_X11 int screen; diff --git a/Source/Core/DolphinWX/Src/GLInterface/AGL.cpp b/Source/Core/DolphinWX/Src/GLInterface/AGL.cpp index 603e6f399c..c18800ad9b 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/AGL.cpp +++ b/Source/Core/DolphinWX/Src/GLInterface/AGL.cpp @@ -20,6 +20,8 @@ #include "RenderBase.h" #include "ConfigManager.h" +#include + #include "VertexShaderManager.h" #include "../GLInterface.h" #include "AGL.h" @@ -32,7 +34,7 @@ void cInterfaceAGL::Swap() // Show the current FPS void cInterfaceAGL::UpdateFPSDisplay(const char *text) { - [GLWin.cocoaWin setTitle: [NSString stringWithUTF8String: text]]; + [[GLWin.cocoaWin window] setTitle: [NSString stringWithUTF8String: text]]; } // Create rendering window. @@ -72,8 +74,7 @@ bool cInterfaceAGL::Create(void *&window_handle) style |= NSResizableWindowMask | NSTitledWindowMask; } - GLWin.cocoaWin = [[NSWindow alloc] initWithContentRect: size - styleMask: style backing: NSBackingStoreBuffered defer: NO]; + GLWin.cocoaWin = (NSView*)(((wxPanel*)window_handle)->GetHandle());; if (GLWin.cocoaWin == nil) { ERROR_LOG(VIDEO, "failed to create window"); return NULL; @@ -84,8 +85,8 @@ bool cInterfaceAGL::Create(void *&window_handle) [GLWin.cocoaWin setLevel: CGShieldingWindowLevel()]; } - [GLWin.cocoaCtx setView: [GLWin.cocoaWin contentView]]; - [GLWin.cocoaWin makeKeyAndOrderFront: nil]; + [GLWin.cocoaCtx setView: GLWin.cocoaWin]; + [[GLWin.cocoaWin window] makeKeyAndOrderFront: nil]; return true; } @@ -94,12 +95,12 @@ bool cInterfaceAGL::MakeCurrent() { int width, height; - width = [[GLWin.cocoaWin contentView] frame].size.width; - height = [[GLWin.cocoaWin contentView] frame].size.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 contentView]]; + [GLWin.cocoaCtx setView: GLWin.cocoaWin]; [GLWin.cocoaCtx update]; [GLWin.cocoaCtx makeCurrentContext]; s_backbuffer_width = width; @@ -110,7 +111,6 @@ bool cInterfaceAGL::MakeCurrent() // Close backend void cInterfaceAGL::Shutdown() { - [GLWin.cocoaWin close]; [GLWin.cocoaCtx clearDrawable]; [GLWin.cocoaCtx release]; }