Ticket #34: svx123-gl-fixes.patch
File svx123-gl-fixes.patch, 1.7 KB (added by , 12 years ago) |
---|
-
src/gla-gl.cc
138 138 // (thus it must not be called from BeginLines(), etc., or within a 139 139 // BeginLines()/EndLines() block etc.) 140 140 #define CHECK_GL_ERROR(M, F) do { \ 141 if (!opengl_initialised) { \ 142 wxLogError(wxT(__FILE__":"STRING(__LINE__)": OpenGL not initialised before (call "F" in method "M")")); \ 143 } \ 141 144 GLenum error_code_ = glGetError(); \ 142 145 if (error_code_ != GL_NO_ERROR) { \ 143 146 wxLogError(wxT(__FILE__":"STRING(__LINE__)": OpenGL error: %s " \ … … 244 247 m_Fog = false; 245 248 m_AntiAlias = false; 246 249 list_flags = 0; 247 // Set the background colour of the canvas to black.248 glClearColor(0.0, 0.0, 0.0, 1.0);249 CHECK_GL_ERROR("GLACanvas", "glClearColor");250 250 } 251 251 252 252 GLACanvas::~GLACanvas() … … 268 268 269 269 SetCurrent(); 270 270 opengl_initialised = true; 271 272 // Set the background colour of the canvas to black. 273 glClearColor(0.0, 0.0, 0.0, 1.0); 274 CHECK_GL_ERROR("FirstShow", "glClearColor"); 275 276 // Set viewport. 277 glViewport(0, 0, x_size, y_size); 278 CHECK_GL_ERROR("FirstShow", "glViewport"); 279 271 280 save_hints = false; 272 281 vendor = wxString((const char *)glGetString(GL_VENDOR), wxConvUTF8); 273 282 renderer = wxString((const char *)glGetString(GL_RENDERER), wxConvUTF8); … … 490 499 // This apparently is (or at least was) needed for Mac OS X. 491 500 wxGLCanvas::OnSize(event); 492 501 502 if (!opengl_initialised) return; 503 493 504 // Set viewport. 494 505 glViewport(0, 0, x_size, y_size); 495 506 CHECK_GL_ERROR("OnSize", "glViewport");