- see if this improves stability of the map editor in newer wxwidgets
This commit is contained in:
parent
ad0b652727
commit
6faa3dc725
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue