mirror of
https://github.com/glest/glest-source.git
synced 2025-08-22 16:02:50 +02:00
try to fix wx 2.8
This commit is contained in:
@@ -304,10 +304,12 @@ MainWindow::MainWindow( std::pair<string,vector<string> > unitToLoad,
|
||||
|
||||
isControlKeyPressed = false;
|
||||
|
||||
initGlCanvas();
|
||||
|
||||
#if wxCHECK_VERSION(2, 9, 1)
|
||||
|
||||
#else
|
||||
if(glCanvas) glCanvas->SetCurrent();
|
||||
glCanvas->SetCurrent();
|
||||
#endif
|
||||
|
||||
unitPath = unitToLoad;
|
||||
@@ -477,8 +479,7 @@ void MainWindow::setupStartupSettings() {
|
||||
|
||||
//printf("In setupStartupSettings #1\n");
|
||||
if(glCanvas == NULL) {
|
||||
int args[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_MIN_ALPHA, 8 }; // to prevent flicker
|
||||
glCanvas = new GlCanvas(this, args);
|
||||
initGlCanvas();
|
||||
|
||||
#if wxCHECK_VERSION(2, 9, 1)
|
||||
|
||||
@@ -576,6 +577,13 @@ MainWindow::~MainWindow(){
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::initGlCanvas(){
|
||||
if(glCanvas == NULL) {
|
||||
int args[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_MIN_ALPHA, 8 }; // to prevent flicker
|
||||
glCanvas = new GlCanvas(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::init() {
|
||||
|
||||
#if wxCHECK_VERSION(2, 9, 3)
|
||||
@@ -583,7 +591,7 @@ void MainWindow::init() {
|
||||
#elif wxCHECK_VERSION(2, 9, 1)
|
||||
|
||||
#else
|
||||
if(glCanvas) glCanvas->SetCurrent();
|
||||
glCanvas->SetCurrent();
|
||||
//printf("setcurrent #2\n");
|
||||
#endif
|
||||
}
|
||||
|
@@ -125,6 +125,7 @@ private:
|
||||
|
||||
bool startupSettingsInited;
|
||||
|
||||
void initGlCanvas();
|
||||
void loadUnit(string path, string skillName);
|
||||
void loadModel(string path);
|
||||
void loadParticle(string path);
|
||||
|
Reference in New Issue
Block a user