From: <tm...@us...> - 2010-05-02 17:27:33
|
Revision: 5134 http://hugin.svn.sourceforge.net/hugin/?rev=5134&view=rev Author: tmodes Date: 2010-05-02 17:27:27 +0000 (Sun, 02 May 2010) Log Message: ----------- Don't open fast preview window if initialisation of OpenGL context failed or if OpenGL 1.3 is not supported. Shows also better error message in this case. Modified Paths: -------------- hugin/trunk/src/hugin1/hugin/GLViewer.cpp Modified: hugin/trunk/src/hugin1/hugin/GLViewer.cpp =================================================================== --- hugin/trunk/src/hugin1/hugin/GLViewer.cpp 2010-05-02 15:00:24 UTC (rev 5133) +++ hugin/trunk/src/hugin1/hugin/GLViewer.cpp 2010-05-02 17:27:27 UTC (rev 5134) @@ -40,8 +40,8 @@ #include "MeshManager.h" #include "PreviewToolHelper.h" #include "GLPreviewFrame.h" +#include "hugin/huginApp.h" - BEGIN_EVENT_TABLE(GLViewer, wxGLCanvas) EVT_PAINT (GLViewer::RedrawE) EVT_SIZE (GLViewer::Resized) @@ -116,15 +116,23 @@ GLenum error_state = glewInit(); if (error_state != GLEW_OK) { - // glewInit failed - DEBUG_ERROR("Error initlialising GLEW: " + // glewInit failed + started_creation=false; + DEBUG_ERROR("Error initialising GLEW: " << glewGetErrorString(error_state) << "."); + frame->Close(); + wxMessageBox(_("Error initialising GLEW\nFast preview window can not be opened."),_("Error"), wxOK | wxICON_ERROR,MainFrame::Get()); + return; } // check the openGL version if (!GLEW_VERSION_1_3) { + started_creation=false; DEBUG_ERROR("Sorry, OpenGL 1.3 is required."); - } + frame->Close(); + wxMessageBox(_("Sorry, for using the fast preview window your graphic card must support at least OpenGL 1.3\nFast preview window can not be opened."),_("Error"), wxOK | wxICON_ERROR,MainFrame::Get()); + return; + } // check, if gpu supports multitextures GLint countMultiTexture; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |