25 #ifndef __glfException_hh__
26 #define __glfException_hh__
28 #include "glfCommon.hh"
39 #define GLF_THROW_EXCEPTION(MESSAGE) \
41 std::stringstream msg; \
43 throw glfException(__FILE__, __LINE__, msg.str()); \
49 #define GLF_THROW_ON_OPENGL_ERROR \
51 GLenum err = glGetError(); \
52 if (err != GL_NO_ERROR) { \
53 GLF_THROW_EXCEPTION("OpenGL Error: " << gluErrorString(err)); \
58 #define GLF_THROW_ON_OPENGL_ERROR_DEBUG GLF_THROW_ON_OPENGL_ERROR
60 #define GLF_THROW_ON_OPENGL_ERROR_DEBUG
66 #define GLF_THROW_ON_OPENGL_ERROR_INFO(MESSAGE) \
68 GLenum err = glGetError(); \
69 if (err != GL_NO_ERROR) { \
70 GLF_THROW_EXCEPTION("["<<MESSAGE<<"] OpenGL Error: " << gluErrorString(err)); \
91 const std::string& message);
96 const std::string& GetFileName()
const;
101 int GetLineNumber()
const;
107 const std::string& GetMessageString()
const;
110 std::string fileName_;
112 std::string message_;
117 #endif // __glfException_hh__
Exception class used for run-time errors in the OpenGLFramework.