From 4cae7bf8d3a33a70cbef7f8b8d25db605387bfaa Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 23 Sep 2013 23:45:17 -0700 Subject: [PATCH] Defer initialization of the GE dbg preview. Maybe it's causing slowdown on some cards to init a new context? --- Windows/GEDebugger/GEDebugger.cpp | 20 +++++++++++++++----- Windows/GEDebugger/GEDebugger.h | 3 +++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Windows/GEDebugger/GEDebugger.cpp b/Windows/GEDebugger/GEDebugger.cpp index 229dde2447..db54132203 100644 --- a/Windows/GEDebugger/GEDebugger.cpp +++ b/Windows/GEDebugger/GEDebugger.cpp @@ -86,18 +86,23 @@ static void RunPauseAction() { } CGEDebugger::CGEDebugger(HINSTANCE _hInstance, HWND _hParent) - : Dialog((LPCSTR)IDD_GEDEBUGGER, _hInstance, _hParent) { + : Dialog((LPCSTR)IDD_GEDEBUGGER, _hInstance, _hParent), frameWindow(NULL) { breakCmds.resize(256, false); - // TODO: Could be scrollable in case the framebuf is larger? Also should be better positioned. - frameWindow = new SimpleGLWindow(m_hInstance, m_hDlg, (750 - 512) / 2, 40, 512, 272); - // TODO: Why doesn't this work? - frameWindow->Clear(); } CGEDebugger::~CGEDebugger() { delete frameWindow; } +void CGEDebugger::SetupFrameWindow() { + if (frameWindow == NULL) { + // TODO: Could be scrollable in case the framebuf is larger? Also should be better positioned. + frameWindow = new SimpleGLWindow(m_hInstance, m_hDlg, (750 - 512) / 2, 40, 512, 272); + // TODO: Why doesn't this work? + frameWindow->Clear(); + } +} + BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: @@ -111,10 +116,15 @@ BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) { Show(false); return TRUE; + case WM_SHOWWINDOW: + SetupFrameWindow(); + break; + case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_GEDBG_BREAK: attached = true; + SetupFrameWindow(); //breakNextOp = true; pauseWait.notify_one(); breakNextDraw = true; diff --git a/Windows/GEDebugger/GEDebugger.h b/Windows/GEDebugger/GEDebugger.h index 0ba85f2019..c0a1283855 100644 --- a/Windows/GEDebugger/GEDebugger.h +++ b/Windows/GEDebugger/GEDebugger.h @@ -31,5 +31,8 @@ public: protected: BOOL DlgProc(UINT message, WPARAM wParam, LPARAM lParam); +private: + void SetupFrameWindow(); + SimpleGLWindow *frameWindow; };