-#ifndef __WXMOTIF__
- if ( GetContext() )
-#endif
- {
- SetCurrent();
- glViewport(0, 0, (GLint) w, (GLint) h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(45.0f, (GLfloat)w/h, 1.0, 100.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- }
+
+ // It's up to the application code to update the OpenGL viewport settings.
+ // In order to avoid extensive context switching, consider doing this in
+ // OnPaint() rather than here, though.
+ glViewport(0, 0, (GLint) w, (GLint) h);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ gluPerspective(45.0f, (GLfloat)w/h, 1.0, 100.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();