From 6faa3dc72543b55e1b469fd19a186d6f8be9c584 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Fri, 28 Nov 2014 23:49:16 -0800 Subject: [PATCH] - see if this improves stability of the map editor in newer wxwidgets --- source/glest_map_editor/main.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/source/glest_map_editor/main.cpp b/source/glest_map_editor/main.cpp index 9b2dc57c..aaef12ae 100644 --- a/source/glest_map_editor/main.cpp +++ b/source/glest_map_editor/main.cpp @@ -138,12 +138,12 @@ END_EVENT_TABLE() void MainWindow::init(string fname) { #if wxCHECK_VERSION(2, 9, 3) - glCanvas->setCurrentGLContext(); + //glCanvas->setCurrentGLContext(); //printf("setcurrent #1\n"); #elif wxCHECK_VERSION(2, 9, 1) #else - glCanvas->SetCurrent(); + //glCanvas->SetCurrent(); //printf("setcurrent #2\n"); #endif @@ -638,11 +638,17 @@ void MainWindow::onPaint(wxPaintEvent &event) { return; } -#if wxCHECK_VERSION(2, 9, 3) +//#if wxCHECK_VERSION(2, 9, 3) -#elif wxCHECK_VERSION(2, 9, 1) - glCanvas->setCurrentGLContext(); -#endif +//#elif wxCHECK_VERSION(2, 9, 1) +// glCanvas->setCurrentGLContext(); +//#endif + + static bool contextSet = false; + if(contextSet == false) { + contextSet = true; + glCanvas->setCurrentGLContext(); + } if(lastPaintEvent.getMillis() < 30) { sleep(1);