diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp index aeabec888b..1b3ab64796 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp @@ -155,7 +155,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress) if ((CommandBuffer.InBuffer.size() == 1) && (CommandBuffer.PayloadBuffer.size() == 1)) { size_t numFile = FileSearch.GetFileNames().size(); - INFO_LOG(WII_IPC_FILEIO, "\t%lu Files found", (u32)numFile); + INFO_LOG(WII_IPC_FILEIO, "\t%lu Files found", (unsigned long)numFile); Memory::Write_U32((u32)numFile, CommandBuffer.PayloadBuffer[0].m_Address); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp index 62a5acbaa4..a395606d87 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp @@ -323,22 +323,13 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight g_VideoInitialize.pUpdateFPSDisplay = &UpdateFPSDisplay; #if defined(USE_WX) && USE_WX - int args[] = {WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0}; - - wxSize size(_twidth, _theight); - GLWin.panel = (wxPanel *)g_VideoInitialize.pWindowHandle; - - GLWin.glCanvas = new wxGLCanvas(GLWin.panel, wxID_ANY, args, - wxPoint(0,0), size, wxSUNKEN_BORDER); + GLWin.glCanvas = new wxGLCanvas(GLWin.panel, wxID_ANY, NULL, + wxPoint(0, 0), wxSize(_twidth, _theight)); GLWin.glCtxt = new wxGLContext(GLWin.glCanvas); - GLWin.glCanvas->Show(TRUE); - - GLWin.glCanvas->SetCurrent(*GLWin.glCtxt); + GLWin.glCanvas->Show(true); #elif defined(__APPLE__) - GLWin.width = s_backbuffer_width; - GLWin.height = s_backbuffer_height; GLWin.cocoaWin = cocoaGLCreateWindow(GLWin.width, GLWin.height); GLWin.cocoaCtx = cocoaGLInit(g_Config.iMultisampleMode); @@ -500,9 +491,17 @@ bool OpenGL_MakeCurrent() void OpenGL_Update() { #if defined(USE_WX) && USE_WX - GLWin.glCanvas->GetSize((int *)&GLWin.width, (int *)&GLWin.height); - s_backbuffer_width = GLWin.width; - s_backbuffer_height = GLWin.height; + int width, height; + + GLWin.panel->GetSize(&width, &height); + if (width == s_backbuffer_width && height == s_backbuffer_height) + return; + + GLWin.glCanvas->SetSize(0, 0, width, height); + GLWin.glCtxt->SetCurrent(*GLWin.glCanvas); + s_backbuffer_width = width; + s_backbuffer_height = height; + #elif defined(__APPLE__) // Is anything needed here? diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h index 8eed926819..dbddbb0159 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h @@ -29,7 +29,7 @@ #include #include -#else // linux and apple basic definitions +#else #if defined(USE_WX) && USE_WX #include @@ -47,13 +47,13 @@ #include "cocoaGL.h" #endif // end USE_WX -#if defined(__APPLE__) +#ifdef __APPLE__ #include #else #include #endif -#endif // linux basic definitions +#endif #ifndef GL_DEPTH24_STENCIL8_EXT // allows FBOs to support stencils #define GL_DEPTH_STENCIL_EXT 0x84F9 @@ -69,8 +69,8 @@ typedef struct { #if defined(USE_WX) && USE_WX wxGLCanvas *glCanvas; - wxPanel *panel; wxGLContext *glCtxt; + wxPanel *panel; #elif defined(__APPLE__) NSWindow *cocoaWin; NSOpenGLContext *cocoaCtx; @@ -87,8 +87,8 @@ typedef struct { XSetWindowAttributes attr; Common::Thread *xEventThread; int x, y; -#endif unsigned int width, height; +#endif } GLWindow; extern GLWindow GLWin; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h b/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h index 0cb3ddf943..322363007d 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h @@ -34,7 +34,7 @@ #include #endif -#if defined(__APPLE__) +#ifdef __APPLE__ #include #else #include diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp index 77f72ff792..1be873863b 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp @@ -118,19 +118,11 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _twidth, int _theight g_VideoInitialize.pUpdateFPSDisplay = &UpdateFPSDisplay; #if defined(USE_WX) && USE_WX - - int args[] = {WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0}; - - wxSize size(_twidth, _theight); - GLWin.panel = (wxPanel *)g_VideoInitialize.pWindowHandle; - - GLWin.glCanvas = new wxGLCanvas(GLWin.panel, wxID_ANY, args, - wxPoint(0,0), size, wxSUNKEN_BORDER); + GLWin.glCanvas = new wxGLCanvas(GLWin.panel, wxID_ANY, NULL, + wxPoint(0, 0), wxSize(_twidth, _theight)); GLWin.glCtxt = new wxGLContext(GLWin.glCanvas); - GLWin.glCanvas->Show(TRUE); - - GLWin.glCanvas->SetCurrent(*GLWin.glCtxt); + GLWin.glCanvas->Show(true); #elif defined(_WIN32) // Create rendering window in Windows @@ -318,9 +310,17 @@ bool OpenGL_MakeCurrent() void OpenGL_Update() { #if defined(USE_WX) && USE_WX - GLWin.glCanvas->GetSize((int *)&GLWin.width, (int *)&GLWin.height); - s_backbuffer_width = GLWin.width; - s_backbuffer_height = GLWin.height; + int width, height; + + GLWin.panel->GetSize(&width, &height); + if (width == s_backbuffer_width && height == s_backbuffer_height) + return; + + GLWin.glCanvas->SetSize(0, 0, width, height); + GLWin.glCtxt->SetCurrent(*GLWin.glCanvas); + s_backbuffer_width = width; + s_backbuffer_height = height; + #elif defined(_WIN32) RECT rcWindow; if (!EmuWindow::GetParentWnd()) diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h index 1af8b28280..ce0e183fb4 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h @@ -31,7 +31,7 @@ #include #include -#else // linux basic definitions +#else #if defined(USE_WX) && USE_WX #include @@ -47,13 +47,13 @@ #include #endif // end USE_WX -#if defined(__APPLE__) +#ifdef __APPLE__ #include #else #include #endif -#endif // linux basic definitions +#endif #ifndef GL_DEPTH24_STENCIL8_EXT // allows FBOs to support stencils #define GL_DEPTH_STENCIL_EXT 0x84F9 @@ -69,8 +69,8 @@ typedef struct { #if defined(USE_WX) && USE_WX wxGLCanvas *glCanvas; - wxPanel *panel; wxGLContext *glCtxt; + wxPanel *panel; #elif defined(HAVE_X11) && HAVE_X11 int screen; Window win; @@ -79,8 +79,8 @@ typedef struct { GLXContext ctx; XSetWindowAttributes attr; int x, y; -#endif unsigned int width, height; +#endif } GLWindow; extern GLWindow GLWin;