MeVisLabToolboxReference
MeVis/Foundation/Sources/MLOpenGL/mlOpenGLSystem.h File Reference

System specific macro definitions. More...

#include "mlSystemWarningsDisable.h"
#include <iostream>
#include <vector>
#include <string>
#include "mlSystemWarningsRestore.h"

Go to the source code of this file.

Defines

#define MLOPENGL_EXPORT   ML_LIBRARY_IMPORT_ATTRIBUTE
#define SO_MEVISLAB_ERR_POST(OSTREAM_VAL)
 Post an error string stream OSTREAM_VAL to the OpenInventor error handler which is redirected to the ML error handler; note that header Inventor/errors/SoDebugError.h, and the classes std::string and std::stringstream must be available to make this macro work.
#define MEVISLAB_CHECK_AND_POST_OPENGL_ERROR(FUNC_NAME)
 A helper macro to check and print OpenGL error states whose argument FUNC_NAME is the name of the function in which the error occurred; see SO_MEVISLAB_ERR_POST for requirements.
Namespace for mlUtils
#define ML_OPENGL_NAMESPACE   ml
 Define the namespace name like in the ML. Default is 'ml'.
#define ML_OPENGL_START_NAMESPACE   namespace ML_OPENGL_NAMESPACE {
 Macro to put all following stuff into the namespace ML_NAMESPACE to avoid collisions with symbols of other libraries.
#define ML_OPENGL_END_NAMESPACE   }
 Closes the namespace for all ML stuff after the usage of ML_UTILS_START_NAMESPACE.

Detailed Description

System specific macro definitions.

Author:
Florian Link
Date:
6/2005

Definition in file mlOpenGLSystem.h.


Define Documentation

#define MEVISLAB_CHECK_AND_POST_OPENGL_ERROR (   FUNC_NAME)
Value:
{ \
      const GLenum err = glGetError(); \
      if (GL_NO_ERROR != err){  \
        if      (GL_OUT_OF_MEMORY     == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Out of memory error" << std::endl); } \
        else if (GL_INVALID_ENUM      == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Invalid enum"        << std::endl); } \
        else if (GL_INVALID_VALUE     == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Invalid value"       << std::endl); } \
        else if (GL_INVALID_OPERATION == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Invalid operation"   << std::endl); } \
        else if (GL_STACK_OVERFLOW    == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Stack overflow"      << std::endl); } \
        else if (GL_STACK_UNDERFLOW   == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Stack underflow"     << std::endl); } \
        else { SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Non standard OpenGL error with id " << err << " detected" << std::endl); } \
      } \
    }

A helper macro to check and print OpenGL error states whose argument FUNC_NAME is the name of the function in which the error occurred; see SO_MEVISLAB_ERR_POST for requirements.

This macro will post errors with OpenInventor SoDebugError::post function.

Definition at line 74 of file mlOpenGLSystem.h.

#define ML_OPENGL_END_NAMESPACE   }

Closes the namespace for all ML stuff after the usage of ML_UTILS_START_NAMESPACE.

Definition at line 32 of file mlOpenGLSystem.h.

#define ML_OPENGL_NAMESPACE   ml

Define the namespace name like in the ML. Default is 'ml'.

Definition at line 20 of file mlOpenGLSystem.h.

#define ML_OPENGL_START_NAMESPACE   namespace ML_OPENGL_NAMESPACE {

Macro to put all following stuff into the namespace ML_NAMESPACE to avoid collisions with symbols of other libraries.

Use ML_OPENGL_END_NAMESPACE to close the namespace.

Definition at line 27 of file mlOpenGLSystem.h.

#define MLOPENGL_EXPORT   ML_LIBRARY_IMPORT_ATTRIBUTE

Definition at line 49 of file mlOpenGLSystem.h.

#define SO_MEVISLAB_ERR_POST (   OSTREAM_VAL)
Value:
{ \
    std::stringstream stroutVal; \
    stroutVal << OSTREAM_VAL;  \
    std::string stdStrBuf = stroutVal.str(); \
    SoDebugError::post(stdStrBuf.c_str(), ""); \
  }

Post an error string stream OSTREAM_VAL to the OpenInventor error handler which is redirected to the ML error handler; note that header Inventor/errors/SoDebugError.h, and the classes std::string and std::stringstream must be available to make this macro work.

Definition at line 60 of file mlOpenGLSystem.h.