13 #ifndef ML_OPENGL_SYSTEM_H
14 #define ML_OPENGL_SYSTEM_H
24 #ifndef ML_OPENGL_NAMESPACE
25 #define ML_OPENGL_NAMESPACE ml
31 #ifndef ML_OPENGL_START_NAMESPACE
32 #define ML_OPENGL_START_NAMESPACE namespace ML_OPENGL_NAMESPACE {
36 #ifndef ML_OPENGL_END_NAMESPACE
37 #define ML_OPENGL_END_NAMESPACE }
41 #include <ThirdPartyWarningsDisable.h>
45 #include <ThirdPartyWarningsRestore.h>
51 #ifdef MLOPENGL_EXPORTS
52 #define MLOPENGL_EXPORT ML_LIBRARY_EXPORT_ATTRIBUTE
54 #define MLOPENGL_EXPORT ML_LIBRARY_IMPORT_ATTRIBUTE
64 #ifndef SO_MEVISLAB_ERR_POST
65 #define SO_MEVISLAB_ERR_POST(OSTREAM_VAL) { \
66 std::stringstream stroutVal; \
67 stroutVal << OSTREAM_VAL; \
68 std::string stdStrBuf = stroutVal.str(); \
69 SoDebugError::post(stdStrBuf.c_str(), ""); \
78 #ifndef MEVISLAB_CHECK_AND_POST_OPENGL_ERROR
79 #define MEVISLAB_CHECK_AND_POST_OPENGL_ERROR(FUNC_NAME) \
81 const GLenum err = glGetError(); \
82 if (GL_NO_ERROR != err){ \
83 if (GL_OUT_OF_MEMORY == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Out of memory error" << std::endl); } \
84 else if (GL_INVALID_ENUM == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Invalid enum" << std::endl); } \
85 else if (GL_INVALID_VALUE == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Invalid value" << std::endl); } \
86 else if (GL_INVALID_OPERATION == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Invalid operation" << std::endl); } \
87 else if (GL_STACK_OVERFLOW == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Stack overflow" << std::endl); } \
88 else if (GL_STACK_UNDERFLOW == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Stack underflow" << std::endl); } \
89 else { SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Non standard OpenGL error with id " << err << " detected" << std::endl); } \