Blob Blame History Raw
diff -r 50a287e4484b src/3Depict.cpp
--- src/3Depict.cpp	Mon Mar 07 01:33:27 2011 +0000
+++ src/3Depict.cpp	Sun Mar 13 00:53:01 2011 +0000
@@ -281,7 +281,7 @@
 MainWindowFrame::MainWindowFrame(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
     wxFrame(parent, id, title, pos, size, style)
 {
-
+	initedOK=false;
 	programmaticEvent=false;
 	fullscreenState=0;
 	//Set up the program icon handler
@@ -324,6 +324,14 @@
     splitterSpectra = new wxSplitterWindow(noteDataView, ID_SPLIT_SPECTRA, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER);
     window_2_pane_2 = new wxPanel(splitterSpectra, wxID_ANY);
     panelTop = new BasicGLPane(splitTopBottom);
+
+    //I had to work this out by studying the construtor
+    if(!panelTop->m_glContext)
+    {
+	    cerr << "Unable to initialise the openGL panel. Program cannot start. Please check your video drivers." << endl;
+	    return;
+    }
+
     panelLeft = new wxPanel(splitLeftRight, wxID_ANY);
     notebookControl = new wxNotebook(panelLeft, ID_NOTEBOOK_CONTROL, wxDefaultPosition, wxDefaultSize, wxNB_RIGHT);
     noteTools = new wxPanel(notebookControl, ID_NOTE_PERFORMANCE, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
@@ -661,7 +669,7 @@
 	delete paths;
 	//-----------------
 
-	   
+	initedOK=true;   
 
 
 	updateTimer->Start(UPDATE_TIMER_DELAY,wxTIMER_CONTINUOUS);
@@ -4208,7 +4216,7 @@
 {
 
     //Register signal handler for backtraces
-        if (!wxApp::OnInit())
+    if (!wxApp::OnInit())
     	return false; 
 
     //Need to seed random number generator for entire program
@@ -4220,6 +4228,10 @@
     
     wxInitAllImageHandlers();
     MainFrame = new MainWindowFrame(NULL, wxID_ANY, wxEmptyString);
+
+    if(!MainFrame->initOK())
+	    return false;
+    
     SetTopWindow(MainFrame);
 
 #ifdef DEBUG
diff -r 50a287e4484b src/3Depict.h
--- src/3Depict.h	Mon Mar 07 01:33:27 2011 +0000
+++ src/3Depict.h	Sun Mar 13 00:53:01 2011 +0000
@@ -108,6 +108,8 @@
 	
 	//!Current fullscreen status
 	unsigned int fullscreenState;
+
+	bool initedOK;
 protected:
     wxTimer *statusTimer;
     wxTimer *progressTimer;
@@ -301,6 +303,10 @@
 
     virtual void SetCommandLineFiles(wxArrayString &files);
     virtual void updateLastRefreshBox();
+
+
+    bool initOK() const {return initedOK;}
+
 }; // wxGlade: end class