From b74271348c7825e169f202f7c377f90d3cc1bd03 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sun, 17 Nov 2013 22:42:51 +0000 Subject: [PATCH] - bugfix for map editor hanging on some windows installations --- source/glest_map_editor/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/glest_map_editor/main.cpp b/source/glest_map_editor/main.cpp index dedf69e0d..819e51e94 100644 --- a/source/glest_map_editor/main.cpp +++ b/source/glest_map_editor/main.cpp @@ -634,7 +634,9 @@ void MainWindow::onPaint(wxPaintEvent &event) { return; } -#if wxCHECK_VERSION(2, 9, 1) +#if wxCHECK_VERSION(2, 9, 3) + +#elif wxCHECK_VERSION(2, 9, 1) glCanvas->setCurrentGLContext(); #endif @@ -1445,6 +1447,13 @@ GlCanvas::~GlCanvas() { void GlCanvas::setCurrentGLContext() { #ifndef __APPLE__ + +#if wxCHECK_VERSION(2, 9, 1) + if(this->context == NULL) { + this->context = new wxGLContext(this); + } +#endif + if(this->context) { this->SetCurrent(*this->context); }