- see if this improves stability of the map editor in newer wxwidgets

This commit is contained in:
SoftCoder 2014-11-28 23:49:16 -08:00
parent ad0b652727
commit 6faa3dc725
1 changed files with 12 additions and 6 deletions

View File

@ -138,12 +138,12 @@ END_EVENT_TABLE()
void MainWindow::init(string fname) { void MainWindow::init(string fname) {
#if wxCHECK_VERSION(2, 9, 3) #if wxCHECK_VERSION(2, 9, 3)
glCanvas->setCurrentGLContext(); //glCanvas->setCurrentGLContext();
//printf("setcurrent #1\n"); //printf("setcurrent #1\n");
#elif wxCHECK_VERSION(2, 9, 1) #elif wxCHECK_VERSION(2, 9, 1)
#else #else
glCanvas->SetCurrent(); //glCanvas->SetCurrent();
//printf("setcurrent #2\n"); //printf("setcurrent #2\n");
#endif #endif
@ -638,11 +638,17 @@ void MainWindow::onPaint(wxPaintEvent &event) {
return; return;
} }
#if wxCHECK_VERSION(2, 9, 3) //#if wxCHECK_VERSION(2, 9, 3)
#elif wxCHECK_VERSION(2, 9, 1) //#elif wxCHECK_VERSION(2, 9, 1)
// glCanvas->setCurrentGLContext();
//#endif
static bool contextSet = false;
if(contextSet == false) {
contextSet = true;
glCanvas->setCurrentGLContext(); glCanvas->setCurrentGLContext();
#endif }
if(lastPaintEvent.getMillis() < 30) { if(lastPaintEvent.getMillis() < 30) {
sleep(1); sleep(1);