From d4eb0684f76b012dbec22285100808608fd2b914 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 4 Aug 2014 23:46:37 -0400 Subject: [PATCH 1/7] Core: Kill off Host_UpdateBreakPointView() Uses wxWidgets event propagation to the parent window which then appropriately handles the breakpoint list updating. --- Source/Core/Core/Host.h | 1 - Source/Core/DolphinWX/Debugger/CodeView.cpp | 6 +++++- Source/Core/DolphinWX/Debugger/MemoryView.cpp | 7 +++++-- Source/Core/DolphinWX/Main.cpp | 11 ----------- Source/Core/DolphinWX/MainAndroid.cpp | 2 -- Source/Core/DolphinWX/MainNoGUI.cpp | 2 -- Source/UnitTests/TestUtils/StubHost.cpp | 1 - 7 files changed, 10 insertions(+), 20 deletions(-) diff --git a/Source/Core/Core/Host.h b/Source/Core/Core/Host.h index 23796cc807..02448754bf 100644 --- a/Source/Core/Core/Host.h +++ b/Source/Core/Core/Host.h @@ -36,7 +36,6 @@ void Host_SetStartupDebuggingParameters(); void Host_SetWiiMoteConnectionState(int _State); void Host_ShowJitResults(unsigned int address); void Host_SysMessage(const char *fmt, ...); -void Host_UpdateBreakPointView(); void Host_UpdateDisasmDialog(); void Host_UpdateLogDisplay(); void Host_UpdateMainFrame(); diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 80b5598dfc..182451beac 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -33,6 +33,7 @@ #include "Common/SymbolDB.h" #include "Core/Core.h" #include "Core/Host.h" +#include "DolphinWX/Globals.h" #include "DolphinWX/WxUtils.h" #include "DolphinWX/Debugger/CodeView.h" #include "DolphinWX/Debugger/DebuggerUIUtil.h" @@ -139,7 +140,10 @@ void CCodeView::ToggleBreakpoint(u32 address) { m_debugger->ToggleBreakpoint(address); Refresh(); - Host_UpdateBreakPointView(); + + // Propagate back to the parent window to update the breakpoint list. + wxCommandEvent evt(wxEVT_HOST_COMMAND, IDM_UPDATEBREAKPOINTS); + GetEventHandler()->AddPendingEvent(evt); } void CCodeView::OnMouseMove(wxMouseEvent& event) diff --git a/Source/Core/DolphinWX/Debugger/MemoryView.cpp b/Source/Core/DolphinWX/Debugger/MemoryView.cpp index 0b4364a75e..c291b9c5ef 100644 --- a/Source/Core/DolphinWX/Debugger/MemoryView.cpp +++ b/Source/Core/DolphinWX/Debugger/MemoryView.cpp @@ -25,7 +25,7 @@ #include "Common/Common.h" #include "Common/DebugInterface.h" -#include "Core/Host.h" +#include "DolphinWX/Globals.h" #include "DolphinWX/WxUtils.h" #include "DolphinWX/Debugger/DebuggerUIUtil.h" #include "DolphinWX/Debugger/MemoryView.h" @@ -97,7 +97,10 @@ void CMemoryView::OnMouseDownL(wxMouseEvent& event) debugger->ToggleMemCheck(YToAddress(y)); Refresh(); - Host_UpdateBreakPointView(); + + // Propagate back to the parent window to update the breakpoint list. + wxCommandEvent evt(wxEVT_HOST_COMMAND, IDM_UPDATEBREAKPOINTS); + GetEventHandler()->AddPendingEvent(evt); } event.Skip(); diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index fb8ea71603..5a2fda3687 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -591,17 +591,6 @@ void Host_UpdateTitle(const std::string& title) main_frame->GetEventHandler()->AddPendingEvent(event); } -void Host_UpdateBreakPointView() -{ - wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEBREAKPOINTS); - main_frame->GetEventHandler()->AddPendingEvent(event); - - if (main_frame->g_pCodeWindow) - { - main_frame->g_pCodeWindow->GetEventHandler()->AddPendingEvent(event); - } -} - void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height) { main_frame->GetRenderWindowSize(x, y, width, height); diff --git a/Source/Core/DolphinWX/MainAndroid.cpp b/Source/Core/DolphinWX/MainAndroid.cpp index b8f05b4684..11e9c34aaa 100644 --- a/Source/Core/DolphinWX/MainAndroid.cpp +++ b/Source/Core/DolphinWX/MainAndroid.cpp @@ -80,8 +80,6 @@ void Host_UpdateMainFrame() { } -void Host_UpdateBreakPointView(){} - void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height) { x = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowXPos; diff --git a/Source/Core/DolphinWX/MainNoGUI.cpp b/Source/Core/DolphinWX/MainNoGUI.cpp index 6deebab93b..5710fc312f 100644 --- a/Source/Core/DolphinWX/MainNoGUI.cpp +++ b/Source/Core/DolphinWX/MainNoGUI.cpp @@ -76,8 +76,6 @@ void Host_UpdateMainFrame() updateMainFrameEvent.Set(); } -void Host_UpdateBreakPointView(){} - void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height) { x = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowXPos; diff --git a/Source/UnitTests/TestUtils/StubHost.cpp b/Source/UnitTests/TestUtils/StubHost.cpp index 7dc5871c8e..c1c1adcae9 100644 --- a/Source/UnitTests/TestUtils/StubHost.cpp +++ b/Source/UnitTests/TestUtils/StubHost.cpp @@ -20,7 +20,6 @@ void Host_UpdateTitle(const std::string&) {} void Host_UpdateLogDisplay() {} void Host_UpdateDisasmDialog() {} void Host_UpdateMainFrame() {} -void Host_UpdateBreakPointView() {} void Host_GetRenderWindowSize(int&, int&, int&, int&) {} void Host_RequestRenderWindowSize(int, int) {} void Host_SetStartupDebuggingParameters() {} From a0a533d3a3ac6b2257d2b7c88033d95d47dcce83 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 5 Aug 2014 00:16:34 -0400 Subject: [PATCH 2/7] UnitTests: Get rid of now-nonexistent Host_GetInstance() within StubHost --- Source/UnitTests/TestUtils/StubHost.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/UnitTests/TestUtils/StubHost.cpp b/Source/UnitTests/TestUtils/StubHost.cpp index c1c1adcae9..cfb20d1dad 100644 --- a/Source/UnitTests/TestUtils/StubHost.cpp +++ b/Source/UnitTests/TestUtils/StubHost.cpp @@ -15,7 +15,6 @@ void Host_RefreshDSPDebuggerWindow() {} void Host_ShowJitResults(unsigned int) {} void Host_Message(int) {} void* Host_GetRenderHandle() { return nullptr; } -void* Host_GetInstance() { return nullptr; } void Host_UpdateTitle(const std::string&) {} void Host_UpdateLogDisplay() {} void Host_UpdateDisasmDialog() {} From 7bf82f19895f1f6b01d5b3971e1e9e4dae5dc154 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 5 Aug 2014 00:35:53 -0400 Subject: [PATCH 3/7] Core: Kill off Host_UpdateLogDisplay() This was actually never used as far as I can tell. There was no wx event handling done whatsoever for the global ID, So this is basically a dead function. --- Source/Core/Common/Logging/Log.h | 4 ---- Source/Core/Core/Boot/Boot.cpp | 2 -- Source/Core/Core/Host.h | 1 - Source/Core/Core/Tracer.cpp | 1 - Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 1 - Source/Core/DolphinWX/Globals.h | 1 - Source/Core/DolphinWX/Main.cpp | 14 -------------- Source/Core/DolphinWX/MainAndroid.cpp | 2 -- Source/Core/DolphinWX/MainNoGUI.cpp | 2 -- Source/UnitTests/TestUtils/StubHost.cpp | 1 - 10 files changed, 29 deletions(-) diff --git a/Source/Core/Common/Logging/Log.h b/Source/Core/Common/Logging/Log.h index fa67058b86..c7675a9a07 100644 --- a/Source/Core/Common/Logging/Log.h +++ b/Source/Core/Common/Logging/Log.h @@ -122,11 +122,7 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, ERROR_LOG(_t_, __VA_ARGS__); \ if (!PanicYesNo(__VA_ARGS__)) {Crash();} \ } -#define _dbg_update_() Host_UpdateLogDisplay(); - #else // not debug -#define _dbg_update_() ; - #ifndef _dbg_assert_ #define _dbg_assert_(_t_, _a_) {} #define _dbg_assert_msg_(_t_, _a_, _desc_, ...) {} diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index fd6a9ac5dd..d6cf708af3 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -429,7 +429,5 @@ bool CBoot::BootUp() // Not part of the binary itself, but either we or Gecko OS might insert // this, and it doesn't clear the icache properly. HLE::Patch(0x800018a8, "GeckoCodehandler"); - - Host_UpdateLogDisplay(); return true; } diff --git a/Source/Core/Core/Host.h b/Source/Core/Core/Host.h index 02448754bf..6cf54b6c95 100644 --- a/Source/Core/Core/Host.h +++ b/Source/Core/Core/Host.h @@ -37,7 +37,6 @@ void Host_SetWiiMoteConnectionState(int _State); void Host_ShowJitResults(unsigned int address); void Host_SysMessage(const char *fmt, ...); void Host_UpdateDisasmDialog(); -void Host_UpdateLogDisplay(); void Host_UpdateMainFrame(); void Host_UpdateStatusBar(const std::string& text, int Filed = 0); void Host_UpdateTitle(const std::string& title); diff --git a/Source/Core/Core/Tracer.cpp b/Source/Core/Core/Tracer.cpp index 5418a24994..36eb420d01 100644 --- a/Source/Core/Core/Tracer.cpp +++ b/Source/Core/Core/Tracer.cpp @@ -106,7 +106,6 @@ int SyncTrace() */ if (difference) { - Host_UpdateLogDisplay(); //Also show drec compare window here //CDynaViewDlg::Show(true); //CDynaViewDlg::ViewAddr(m_BlockStart); diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index dbc2e50608..a5717b2eb3 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -285,7 +285,6 @@ void CCodeWindow::SingleStep() // need a short wait here JumpToAddress(PC); Update(); - Host_UpdateLogDisplay(); } } diff --git a/Source/Core/DolphinWX/Globals.h b/Source/Core/DolphinWX/Globals.h index 2a8fc02854..1ca1ecc911 100644 --- a/Source/Core/DolphinWX/Globals.h +++ b/Source/Core/DolphinWX/Globals.h @@ -245,7 +245,6 @@ enum IDM_COMPRESSGCM, IDM_MULTICOMPRESSGCM, IDM_MULTIDECOMPRESSGCM, - IDM_UPDATELOGDISPLAY, IDM_UPDATEDISASMDIALOG, IDM_UPDATEGUI, IDM_UPDATESTATUSBAR, diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index 5a2fda3687..10dede9891 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -542,19 +542,6 @@ void Host_NotifyMapLoaded() } } - -void Host_UpdateLogDisplay() -{ - wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATELOGDISPLAY); - main_frame->GetEventHandler()->AddPendingEvent(event); - - if (main_frame->g_pCodeWindow) - { - main_frame->g_pCodeWindow->GetEventHandler()->AddPendingEvent(event); - } -} - - void Host_UpdateDisasmDialog() { wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEDISASMDIALOG); @@ -566,7 +553,6 @@ void Host_UpdateDisasmDialog() } } - void Host_ShowJitResults(unsigned int address) { if (main_frame->g_pCodeWindow && main_frame->g_pCodeWindow->m_JitWindow) diff --git a/Source/Core/DolphinWX/MainAndroid.cpp b/Source/Core/DolphinWX/MainAndroid.cpp index 11e9c34aaa..3831c686d0 100644 --- a/Source/Core/DolphinWX/MainAndroid.cpp +++ b/Source/Core/DolphinWX/MainAndroid.cpp @@ -72,8 +72,6 @@ void Host_UpdateTitle(const std::string& title) __android_log_write(ANDROID_LOG_INFO, DOLPHIN_TAG, title.c_str()); } -void Host_UpdateLogDisplay(){} - void Host_UpdateDisasmDialog(){} void Host_UpdateMainFrame() diff --git a/Source/Core/DolphinWX/MainNoGUI.cpp b/Source/Core/DolphinWX/MainNoGUI.cpp index 5710fc312f..2603727aaa 100644 --- a/Source/Core/DolphinWX/MainNoGUI.cpp +++ b/Source/Core/DolphinWX/MainNoGUI.cpp @@ -67,8 +67,6 @@ void* Host_GetRenderHandle() void Host_UpdateTitle(const std::string& title){}; -void Host_UpdateLogDisplay(){} - void Host_UpdateDisasmDialog(){} void Host_UpdateMainFrame() diff --git a/Source/UnitTests/TestUtils/StubHost.cpp b/Source/UnitTests/TestUtils/StubHost.cpp index cfb20d1dad..f7ec9e54a4 100644 --- a/Source/UnitTests/TestUtils/StubHost.cpp +++ b/Source/UnitTests/TestUtils/StubHost.cpp @@ -16,7 +16,6 @@ void Host_ShowJitResults(unsigned int) {} void Host_Message(int) {} void* Host_GetRenderHandle() { return nullptr; } void Host_UpdateTitle(const std::string&) {} -void Host_UpdateLogDisplay() {} void Host_UpdateDisasmDialog() {} void Host_UpdateMainFrame() {} void Host_GetRenderWindowSize(int&, int&, int&, int&) {} From 2b341bb267bd31b048a0031f651a598cc6506730 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 5 Aug 2014 01:34:42 -0400 Subject: [PATCH 4/7] D3D: Remove an unnecessary call to Host_GetRenderWindowSize() --- Source/Core/VideoBackends/D3D/Render.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index 30b638d2b9..09d0af5b65 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -179,10 +179,6 @@ void CreateScreenshotTexture(const TargetRectangle& rc) Renderer::Renderer(void *&window_handle) { - int x, y, w_temp, h_temp; - - Host_GetRenderWindowSize(x, y, w_temp, h_temp); - D3D::Create((HWND)window_handle); s_backbuffer_width = D3D::GetBackBufferWidth(); From df67a18c42d543657c876954a1b5bac166b9de51 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 5 Aug 2014 02:51:32 -0400 Subject: [PATCH 5/7] WGL: Get rid of the use of the Host_GetRenderWindowSize() call. Just use the Windows API to accomplish the same thing (this is what is done in Update()). This makes the backing window handle the correct data-type for Windows for easier use in function calls. --- Source/Core/DolphinWX/GLInterface/WGL.cpp | 27 ++++++++++++++--------- Source/Core/DolphinWX/GLInterface/WGL.h | 2 +- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Source/Core/DolphinWX/GLInterface/WGL.cpp b/Source/Core/DolphinWX/GLInterface/WGL.cpp index 94bc0e3c36..39e18f9105 100644 --- a/Source/Core/DolphinWX/GLInterface/WGL.cpp +++ b/Source/Core/DolphinWX/GLInterface/WGL.cpp @@ -58,7 +58,7 @@ bool cInterfaceWGL::PeekMessages() // Show the current FPS void cInterfaceWGL::UpdateFPSDisplay(const std::string& text) { - SetWindowTextA((HWND)m_window_handle, text.c_str()); + SetWindowTextA(m_window_handle, text.c_str()); } // Create rendering window. @@ -68,14 +68,19 @@ bool cInterfaceWGL::Create(void *&window_handle) if (window_handle == nullptr) return false; - int _tx, _ty, _twidth, _theight; - Host_GetRenderWindowSize(_tx, _ty, _twidth, _theight); + HWND window_handle_reified = reinterpret_cast(window_handle); + RECT window_rect = {0}; + + if (!GetClientRect(window_handle_reified, &window_rect)) + return false; // Control window size and picture scaling - s_backbuffer_width = _twidth; - s_backbuffer_height = _theight; + int twidth = (window_rect.right - window_rect.left); + int theight = (window_rect.bottom - window_rect.top); + s_backbuffer_width = twidth; + s_backbuffer_height = theight; - m_window_handle = window_handle; + m_window_handle = window_handle_reified; #ifdef _WIN32 dllHandle = LoadLibrary(TEXT("OpenGL32.dll")); @@ -105,7 +110,7 @@ bool cInterfaceWGL::Create(void *&window_handle) int PixelFormat; // Holds The Results After Searching For A Match - if (!(hDC = GetDC((HWND)window_handle))) { + if (!(hDC = GetDC(window_handle_reified))) { PanicAlert("(1) Can't create an OpenGL Device context. Fail."); return false; } @@ -145,11 +150,11 @@ bool cInterfaceWGL::ClearCurrent() void cInterfaceWGL::Update() { RECT rcWindow; - GetClientRect((HWND)m_window_handle, &rcWindow); + GetClientRect(m_window_handle, &rcWindow); // Get the new window width and height - s_backbuffer_width = rcWindow.right - rcWindow.left; - s_backbuffer_height = rcWindow.bottom - rcWindow.top; + s_backbuffer_width = (rcWindow.right - rcWindow.left); + s_backbuffer_height = (rcWindow.bottom - rcWindow.top); } // Close backend @@ -166,7 +171,7 @@ void cInterfaceWGL::Shutdown() hRC = nullptr; } - if (hDC && !ReleaseDC((HWND)m_window_handle, hDC)) + if (hDC && !ReleaseDC(m_window_handle, hDC)) { ERROR_LOG(VIDEO, "Attempt to release device context failed."); hDC = nullptr; diff --git a/Source/Core/DolphinWX/GLInterface/WGL.h b/Source/Core/DolphinWX/GLInterface/WGL.h index 529168b578..e3bea0b044 100644 --- a/Source/Core/DolphinWX/GLInterface/WGL.h +++ b/Source/Core/DolphinWX/GLInterface/WGL.h @@ -22,5 +22,5 @@ public: void Update(); bool PeekMessages(); - void* m_window_handle; + HWND m_window_handle; }; From 7692f5a5ce619dc005c6f0e735353efe53e57395 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 5 Aug 2014 03:33:45 -0400 Subject: [PATCH 6/7] AGL: Remove the call to Host_GetRenderWindowSize(). Just uses platform-specific ways to do the same thing. --- Source/Core/DolphinWX/GLInterface/AGL.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Source/Core/DolphinWX/GLInterface/AGL.cpp b/Source/Core/DolphinWX/GLInterface/AGL.cpp index 9d295cb503..1abb97019d 100644 --- a/Source/Core/DolphinWX/GLInterface/AGL.cpp +++ b/Source/Core/DolphinWX/GLInterface/AGL.cpp @@ -4,9 +4,6 @@ #include -#include "Core/ConfigManager.h" -#include "Core/Host.h" - #include "DolphinWX/GLInterface/GLInterface.h" #include "VideoCommon/RenderBase.h" #include "VideoCommon/VertexShaderManager.h" @@ -21,10 +18,9 @@ void cInterfaceAGL::Swap() // Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize() bool cInterfaceAGL::Create(void *&window_handle) { - int _tx, _ty, _twidth, _theight; - Host_GetRenderWindowSize(_tx, _ty, _twidth, _theight); - - GLWin.cocoaWin = (NSView*)(((wxPanel*)window_handle)->GetHandle()); + // FIXME: Get rid of the explicit use of wxPanel here. This shouldn't be necessary. + GLWin.cocoaWin = reinterpret_cast(((wxPanel*)window_handle)->GetHandle()); + NSSize size = [GLWin.cocoaWin frame].size; // Enable high-resolution display support. [GLWin.cocoaWin setWantsBestResolutionOpenGLSurface:YES]; @@ -32,12 +28,12 @@ bool cInterfaceAGL::Create(void *&window_handle) NSWindow *window = [GLWin.cocoaWin window]; float scale = [window backingScaleFactor]; - _twidth *= scale; - _theight *= scale; + size.width *= scale; + size.height *= scale; // Control window size and picture scaling - s_backbuffer_width = _twidth; - s_backbuffer_height = _theight; + s_backbuffer_width = size.width; + s_backbuffer_height = size.height; NSOpenGLPixelFormatAttribute attr[] = { NSOpenGLPFADoubleBuffer, NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, NSOpenGLPFAAccelerated, 0 }; NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc] From dc2bc621a4ab405671568c831e8228ad94aaf565 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 5 Aug 2014 05:31:28 -0400 Subject: [PATCH 7/7] GLX: Remove all Host_GetRenderWindowSize calls. Also remove x, y, width and height from the GLInterface, since it's only used in GLX, which no longer uses them --- .../Core/DolphinWX/GLInterface/GLInterface.h | 2 -- Source/Core/DolphinWX/GLInterface/GLX.cpp | 22 ------------------- .../Core/DolphinWX/GLInterface/Platform.cpp | 2 -- .../Core/DolphinWX/GLInterface/X11_Util.cpp | 14 +++--------- 4 files changed, 3 insertions(+), 37 deletions(-) diff --git a/Source/Core/DolphinWX/GLInterface/GLInterface.h b/Source/Core/DolphinWX/GLInterface/GLInterface.h index 26c92f53d4..c57194140e 100644 --- a/Source/Core/DolphinWX/GLInterface/GLInterface.h +++ b/Source/Core/DolphinWX/GLInterface/GLInterface.h @@ -104,8 +104,6 @@ typedef struct { XSetWindowAttributes attr; std::thread xEventThread; #endif - int x, y; - unsigned int width, height; } GLWindow; extern GLWindow GLWin; diff --git a/Source/Core/DolphinWX/GLInterface/GLX.cpp b/Source/Core/DolphinWX/GLInterface/GLX.cpp index 8c9005bd81..320d0f884a 100644 --- a/Source/Core/DolphinWX/GLInterface/GLX.cpp +++ b/Source/Core/DolphinWX/GLInterface/GLX.cpp @@ -4,8 +4,6 @@ #include -#include "Core/Host.h" - #include "DolphinWX/GLInterface/GLInterface.h" #include "VideoCommon/RenderBase.h" @@ -41,13 +39,6 @@ void cInterfaceGLX::Swap() // Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize() bool cInterfaceGLX::Create(void *&window_handle) { - int _tx, _ty, _twidth, _theight; - Host_GetRenderWindowSize(_tx, _ty, _twidth, _theight); - - // Control window size and picture scaling - s_backbuffer_width = _twidth; - s_backbuffer_height = _theight; - int glxMajorVersion, glxMinorVersion; // attributes for a single buffered visual in RGBA format with at least @@ -113,11 +104,6 @@ bool cInterfaceGLX::Create(void *&window_handle) return false; } - GLWin.x = _tx; - GLWin.y = _ty; - GLWin.width = _twidth; - GLWin.height = _theight; - XWindow.CreateXWindow(); window_handle = (void *)GLWin.win; return true; @@ -125,14 +111,6 @@ bool cInterfaceGLX::Create(void *&window_handle) bool cInterfaceGLX::MakeCurrent() { - // connect the glx-context to the window - #if defined(HAVE_WX) && (HAVE_WX) - Host_GetRenderWindowSize(GLWin.x, GLWin.y, - (int&)GLWin.width, (int&)GLWin.height); - XMoveResizeWindow(GLWin.evdpy, GLWin.win, GLWin.x, GLWin.y, - GLWin.width, GLWin.height); - #endif - bool success = glXMakeCurrent(GLWin.dpy, GLWin.win, GLWin.ctx); if (success) { diff --git a/Source/Core/DolphinWX/GLInterface/Platform.cpp b/Source/Core/DolphinWX/GLInterface/Platform.cpp index 6dc8826c46..86b12858dc 100644 --- a/Source/Core/DolphinWX/GLInterface/Platform.cpp +++ b/Source/Core/DolphinWX/GLInterface/Platform.cpp @@ -135,8 +135,6 @@ bool cPlatform::Init(EGLConfig config, void *window_handle) ANativeWindow_setBuffersGeometry((EGLNativeWindowType)Host_GetRenderHandle(), 0, 0, format); int none, width, height; Host_GetRenderWindowSize(none, none, width, height); - GLWin.width = width; - GLWin.height = height; GLInterface->SetBackBufferDimensions(width, height); #endif return true; diff --git a/Source/Core/DolphinWX/GLInterface/X11_Util.cpp b/Source/Core/DolphinWX/GLInterface/X11_Util.cpp index 06bf09fe80..a1060e8b87 100644 --- a/Source/Core/DolphinWX/GLInterface/X11_Util.cpp +++ b/Source/Core/DolphinWX/GLInterface/X11_Util.cpp @@ -19,8 +19,7 @@ bool cXInterface::ServerConnect(void) bool cXInterface::Initialize(void *config, void *window_handle) { - int _tx, _ty, _twidth, _theight; - XVisualInfo visTemplate; + XVisualInfo visTemplate; int num_visuals; EGLint vid; @@ -42,13 +41,6 @@ bool cXInterface::Initialize(void *config, void *window_handle) exit(1); } - Host_GetRenderWindowSize(_tx, _ty, _twidth, _theight); - - GLWin.x = _tx; - GLWin.y = _ty; - GLWin.width = _twidth; - GLWin.height = _theight; - GLWin.evdpy = XOpenDisplay(nullptr); GLWin.parent = (Window) window_handle; GLWin.screen = DefaultScreen(GLWin.dpy); @@ -81,7 +73,7 @@ void *cXInterface::CreateWindow(void) // Create the window GLWin.win = XCreateWindow(GLWin.evdpy, GLWin.parent, - GLWin.x, GLWin.y, GLWin.width, GLWin.height, 0, + 0, 0, 1, 1, 0, GLWin.vi->depth, InputOutput, GLWin.vi->visual, CWBorderPixel | CWBackPixel | CWColormap | CWEventMask, &GLWin.attr); wmProtocols[0] = XInternAtom(GLWin.evdpy, "WM_DELETE_WINDOW", True); @@ -131,7 +123,7 @@ void cX11Window::CreateXWindow(void) // Create the window GLWin.win = XCreateWindow(GLWin.evdpy, GLWin.parent, - GLWin.x, GLWin.y, GLWin.width, GLWin.height, 0, + 0, 0, 1, 1, 0, GLWin.vi->depth, InputOutput, GLWin.vi->visual, CWBorderPixel | CWBackPixel | CWColormap | CWEventMask, &GLWin.attr); wmProtocols[0] = XInternAtom(GLWin.evdpy, "WM_DELETE_WINDOW", True);