-ScanCodeDialog::ScanCodeDialog( wxWindow* parent, wxWindowID id,
- const int code, const wxString &descr, const wxString& title )
- : wxDialog( parent, id, title, wxPoint(-1, -1), wxSize(96*2,76*2) )
-{
- new wxStaticText( this, -1, "Scancode", wxPoint(4*2,3*2),
- wxSize(31*2,12*2) );
- m_ScanCode = new ScanCodeCtrl( this, -1, code, wxPoint(37*2,6*2),
- wxSize(53*2,14*2) );
-
- new wxStaticText( this, -1, "Description", wxPoint(4*2,24*2),
- wxSize(32*2,12*2) );
- m_Description = new wxTextCtrl( this, -1, descr, wxPoint(37*2,27*2),
- wxSize(53*2,14*2) );
-
- new wxButton( this, wxID_OK, "Ok", wxPoint(20*2,50*2), wxSize(20*2,13*2) );
- new wxButton( this, wxID_CANCEL, "Cancel", wxPoint(44*2,50*2),
- wxSize(25*2,13*2) );
+ for ( ;; )
+ {
+ GLenum err = glGetError();
+ if ( err == GL_NO_ERROR )
+ return;
+
+ // normally the error is reset by the call to glGetError() but if
+ // glGetError() itself returns an error, we risk looping forever here
+ // so check that we get a different error than the last time
+ if ( err == errLast )
+ {
+ wxLogError(wxT("OpenGL error state couldn't be reset."));
+ return;
+ }
+
+ errLast = err;
+
+ wxLogError(wxT("OpenGL error %d"), err);
+ }