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; };