mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 11:42:31 +01:00
bugfix g3d viewer glewinit was not working
This commit is contained in:
parent
1097938c2e
commit
e4e7a7dc00
@ -474,6 +474,13 @@ void MainWindow::setupTimer() {
|
||||
}
|
||||
|
||||
void MainWindow::setupStartupSettings() {
|
||||
GLuint err = glewInit();
|
||||
if (GLEW_OK != err) {
|
||||
fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err));
|
||||
//return 1;
|
||||
throw std::runtime_error((char *)glewGetErrorString(err));
|
||||
}
|
||||
|
||||
renderer= Renderer::getInstance();
|
||||
|
||||
for(unsigned int i = 0; i < autoScreenShotParams.size(); ++i) {
|
||||
@ -555,19 +562,14 @@ void MainWindow::init() {
|
||||
|
||||
#if wxCHECK_VERSION(2, 9, 3)
|
||||
glCanvas->setCurrentGLContext();
|
||||
//printf("setcurrent #1\n");
|
||||
#elif wxCHECK_VERSION(2, 9, 1)
|
||||
|
||||
#else
|
||||
glCanvas->SetCurrent();
|
||||
//printf("setcurrent #2\n");
|
||||
#endif
|
||||
|
||||
GLuint err = glewInit();
|
||||
if (GLEW_OK != err) {
|
||||
fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err));
|
||||
//return 1;
|
||||
throw std::runtime_error((char *)glewGetErrorString(err));
|
||||
}
|
||||
|
||||
//renderer->init();
|
||||
|
||||
//wxCommandEvent event;
|
||||
@ -1997,8 +1999,9 @@ GlCanvas::~GlCanvas() {
|
||||
|
||||
void GlCanvas::setCurrentGLContext() {
|
||||
#ifndef __APPLE__
|
||||
//printf("Set ctx [%p]\n",this->context);
|
||||
if(this->context) {
|
||||
this->SetCurrent(*this->context);
|
||||
wxGLCanvas::SetCurrent(*this->context);
|
||||
}
|
||||
#else
|
||||
this->SetCurrent();
|
||||
|
Loading…
x
Reference in New Issue
Block a user