trying to fix map editor for wxwidget 2.8 too
This commit is contained in:
parent
c9400cc3b1
commit
1385f3fea2
|
@ -140,15 +140,6 @@ BEGIN_EVENT_TABLE(MainToolBar, wxToolBar)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
void MainWindow::init(string fname) {
|
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
|
//menus
|
||||||
menuBar = new wxMenuBar();
|
menuBar = new wxMenuBar();
|
||||||
|
@ -458,6 +449,17 @@ void MainWindow::init(string fname) {
|
||||||
//setDirty(false);
|
//setDirty(false);
|
||||||
//setExtension();
|
//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) {
|
if(startupSettingsInited == false) {
|
||||||
startupSettingsInited = true;
|
startupSettingsInited = true;
|
||||||
setupStartupSettings();
|
setupStartupSettings();
|
||||||
|
@ -482,12 +484,20 @@ void MainWindow::onClose(wxCloseEvent &event) {
|
||||||
this->Destroy();
|
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() {
|
void MainWindow::setupStartupSettings() {
|
||||||
|
|
||||||
//gl canvas
|
//gl canvas
|
||||||
if(glCanvas == NULL) {
|
if(glCanvas == NULL) {
|
||||||
int args[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_MIN_ALPHA, 8 };
|
initGlCanvas();
|
||||||
glCanvas = new GlCanvas(this, this->panel, args);
|
|
||||||
|
|
||||||
boxsizer->Add(glCanvas, 1, wxEXPAND);
|
boxsizer->Add(glCanvas, 1, wxEXPAND);
|
||||||
|
|
||||||
|
|
|
@ -287,6 +287,7 @@ private:
|
||||||
void setDirty(bool val=true);
|
void setDirty(bool val=true);
|
||||||
void setExtension();
|
void setExtension();
|
||||||
void setupStartupSettings();
|
void setupStartupSettings();
|
||||||
|
void initGlCanvas();
|
||||||
};
|
};
|
||||||
|
|
||||||
// =====================================================
|
// =====================================================
|
||||||
|
|
Loading…
Reference in New Issue