Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GLError.cc
1 /*===========================================================================*\
2  * *
3  * OpenFlipper *
4  * Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
5  * www.openflipper.org *
6  * *
7  *---------------------------------------------------------------------------*
8  * This file is part of OpenFlipper. *
9  * *
10  * OpenFlipper is free software: you can redistribute it and/or modify *
11  * it under the terms of the GNU Lesser General Public License as *
12  * published by the Free Software Foundation, either version 3 of *
13  * the License, or (at your option) any later version with the *
14  * following exceptions: *
15  * *
16  * If other files instantiate templates or use macros *
17  * or inline functions from this file, or you compile this file and *
18  * link it with other files to produce an executable, this file does *
19  * not by itself cause the resulting executable to be covered by the *
20  * GNU Lesser General Public License. This exception does not however *
21  * invalidate any other reasons why the executable file might be *
22  * covered by the GNU Lesser General Public License. *
23  * *
24  * OpenFlipper is distributed in the hope that it will be useful, *
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
27  * GNU Lesser General Public License for more details. *
28  * *
29  * You should have received a copy of the GNU LesserGeneral Public *
30  * License along with OpenFlipper. If not, *
31  * see <http://www.gnu.org/licenses/>. *
32  * *
33 \*===========================================================================*/
34 
35 /*===========================================================================*\
36  * *
37  * $Revision: 10745 $ *
38  * $Author: moebius $ *
39  * $Date: 2011-01-26 10:23:50 +0100 (Wed, 26 Jan 2011) $ *
40  * *
41 \*===========================================================================*/
42 
43 
44 //=============================================================================
45 //
46 // GLError
47 //
48 //=============================================================================
49 
50 //=============================================================================
51 //
52 // Includes
53 //
54 //=============================================================================
55 
56 #include "GLError.hh"
57 #include <string>
58 
59 //=============================================================================
60 namespace ACG {
61 //=============================================================================
62 
63 std::string glErrorToString( GLenum _error ) {
64  switch (_error) {
65  case GL_NO_ERROR: return "No Error";
66  case GL_INVALID_ENUM: return "invalid enumerant";
67  case GL_INVALID_VALUE: return "invalid value";
68  case GL_INVALID_OPERATION: return "invalid operation";
69 # if defined(GL_INVALID_FRAMEBUFFER_OPERATION)
70  case GL_INVALID_FRAMEBUFFER_OPERATION: return "invalid framebuffer operation";
71 #endif
72  case GL_STACK_OVERFLOW: return "Stack overflow";
73  case GL_STACK_UNDERFLOW: return "stack underflow";
74  case GL_OUT_OF_MEMORY: return "out of memory";
75  default:
76  return "Unknown OpenGL Error! glErrorToString is unable to convert this error number to a string!" ;
77  }
78 }
79 
80 
81 void nurbsErrorCallback(GLenum errorCode)
82 {
83  const GLubyte *estring;
84  estring = gluErrorString(errorCode);
85  std::cerr << "Nurbs Error: " << estring << std::endl;;
86 }
87 
88 //=============================================================================
89 } // namespace ACG
90 //=============================================================================
91 
Namespace providing different geometric functions concerning angles.
Definition: DBSCANT.cc:10
std::string glErrorToString(GLenum _error)
replaces the gluErrorToString function at least for the standard OpenGL Headers
Definition: GLError.cc:63