trying to fix map editor for wxwidget 2.8 too

This commit is contained in:
titiger 2016-01-23 19:05:32 +01:00
parent c9400cc3b1
commit 1385f3fea2
2 changed files with 22 additions and 11 deletions

View File

@ -140,15 +140,6 @@ BEGIN_EVENT_TABLE(MainToolBar, wxToolBar)
END_EVENT_TABLE()
void MainWindow::init(string fname) {
#if wxCHECK_VERSION(2, 9, 3)
//glCanvas->setCurrentGLContext();
//printf("setcurrent #1\n");
#elif wxCHECK_VERSION(2, 9, 1)
#else
if(glCanvas) glCanvas->SetCurrent();
//printf("setcurrent #2\n");
#endif
//menus
menuBar = new wxMenuBar();
@ -458,6 +449,17 @@ void MainWindow::init(string fname) {
//setDirty(false);
//setExtension();
initGlCanvas();
#if wxCHECK_VERSION(2, 9, 3)
//glCanvas->setCurrentGLContext();
//printf("setcurrent #1\n");
#elif wxCHECK_VERSION(2, 9, 1)
#else
if(glCanvas) glCanvas->SetCurrent();
//printf("setcurrent #2\n");
#endif
if(startupSettingsInited == false) {
startupSettingsInited = true;
setupStartupSettings();
@ -482,12 +484,20 @@ void MainWindow::onClose(wxCloseEvent &event) {
this->Destroy();
}
void MainWindow::initGlCanvas(){
if(glCanvas == NULL) {
int args[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_MIN_ALPHA, 8 };
glCanvas = new GlCanvas(this, this->panel, args);
boxsizer->Add(glCanvas, 1, wxEXPAND);
}
}
void MainWindow::setupStartupSettings() {
//gl canvas
if(glCanvas == NULL) {
int args[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_MIN_ALPHA, 8 };
glCanvas = new GlCanvas(this, this->panel, args);
initGlCanvas();
boxsizer->Add(glCanvas, 1, wxEXPAND);

View File

@ -287,6 +287,7 @@ private:
void setDirty(bool val=true);
void setExtension();
void setupStartupSettings();
void initGlCanvas();
};
// =====================================================