MeVisLabToolboxReference
|
00001 // **InsertLicense** code 00002 //---------------------------------------------------------------------------------- 00004 00009 //---------------------------------------------------------------------------------- 00010 00011 #ifndef __mlOpenGL_H 00012 #define __mlOpenGL_H 00013 00014 #include "mlOpenGLSystem.h" 00015 00016 #ifdef _MSC_VER 00017 #pragma warning( push ) 00018 // suppress warning that is irrelevant for private static members: 00019 #pragma warning(disable : 4251 ) // class 'std::string' needs to have dll-interface to be used by clients of class 'ml::OpenGL' 00020 #endif 00021 00022 // include the glew header, which allows to access the whole OpenGL and extensions API 00023 // without using native windows or unix headers 00024 #include "mlSystemWarningsDisable.h" 00025 #include <GL/glew.h> 00026 #include <stdio.h> 00027 #include <string> 00028 #include "mlSystemWarningsRestore.h" 00029 00030 ML_OPENGL_START_NAMESPACE 00031 00033 00055 class MLOPENGL_EXPORT OpenGL 00056 { 00057 public: 00059 static bool init(); 00060 00062 static const std::string& getVendorString(); 00063 00065 static const std::string& getRendererString(); 00066 00068 static const std::string& getVersionString(); 00069 00071 static bool supportsRenderTo3DTexture(); 00072 00074 static bool supportsPBO(); 00075 00078 static bool supportsFastTexture3D(); 00079 00081 static GLint getMaxTextureSize(); 00082 00084 static GLint getMaxTextureSize3D(); 00085 00087 static GLint getMaxTextureImageUnits(); 00088 00090 static GLint getMaxVertexAttributes(); 00091 00093 static GLint getMaxVaryingFloats(); 00094 00096 static GLint getMaxPixelMapTableSize(); 00097 00099 static GLint getMaxTextureColorTableSize(); 00100 00102 static GLint getMaxPalettedTextureTableSize(); 00103 00105 static bool isSupported(const char* extension); 00106 00112 static void clearTextureUnitsAndShaders(); 00113 00114 private: 00115 static GLint _maxPixelMapTableSize; 00116 static GLint _maxGLTextureSize; 00117 static GLint _maxGLTextureSize3D; 00118 static GLint _maxTextureImageUnits; 00119 static GLint _maxVertexAttributes; 00120 static GLint _maxVaryingFloats; 00121 static bool _supportsRenderTo3DTexture; 00122 00123 static void queryCapabilities(); 00124 00125 static std::string getGLString(int name); 00126 00127 static std::string _vendor; 00128 static std::string _renderer; 00129 static std::string _version; 00130 00131 }; 00132 00133 ML_OPENGL_END_NAMESPACE 00134 00135 #ifdef _MSC_VER 00136 #pragma warning( pop ) 00137 #endif 00138 00139 00140 #endif 00141