MeVisLab Toolbox Reference
|
MeVis OpenGL Information Interface (Singleton) More...
#include <mlOpenGL.h>
Classes | |
struct | TypeInfo |
Struct to store infos about a type, e.g. about a uniform. More... | |
Static Public Member Functions | |
static bool | init () |
initialize the OpenGL information and GLEW, returns true if everything is ok | |
static const std::string & | getVendorString () |
get the open gl vendor string | |
static const std::string & | getRendererString () |
get the open gl driver string | |
static const std::string & | getVersionString () |
get the open gl version string | |
static bool | isMesaSoftwareRenderer () |
returns if the OpenGL driver is the Mesa software renderer (typically llvmpipe). | |
static bool | supports10Bit () |
returns if the OpenGL driver supports visible 10bit OpenGL contexts. | |
static bool | supportsRenderTo3DTexture () |
Returns if rendering to 3D textures is supported by FrameBufferObjects. | |
static bool | supportsPBO () |
Returns if PixelBufferObjects are supported. | |
static GLint | getVideoMemorySizeInMB () |
Returns the maximum available video memory size in MB. | |
static GLint | getMaxTextureSize () |
returns max 2d texture size (using GL_MAX_TEXTURE_SIZE) | |
static GLint | getMaxTextureSize3D () |
returns max 3d texture size (using GL_MAX_3D_TEXTURE_SIZE) | |
static GLint | getMaxTextureImageUnits () |
returns max available texture units (using GL_MAX_TEXTURE_IMAGE_UNITS) | |
static GLint | getMaxVertexAttributes () |
returns max available vertex attributes (using GL_MAX_VERTEX_ATTRIBS) | |
static GLint | getMaxVaryingFloats () |
returns max available varying floats ( using GL_MAX_VARYING_FLOATS ) | |
static GLint | getMaxSmoothLineWidth () |
returns max size of a supported smooth line width | |
static GLint | getMaxClipPlanes () |
returns max number of clip planes | |
static GLint | getMaxLights () |
returns max number of lights | |
static bool | isSupported (const char *extension) |
check if the given extension is supported | |
static void | clearTextureUnitsAndShaders () |
this method binds the 0 target to all texture units and ARB/GLSL shaders and it should be called in code that causes ATI OGL driver crashes when resources are freed in a shared context and have been previously bound in the original context (even if the state was popped afterwards) NOTE: needs a valid OpenGL context | |
static void | disableAllClipPlanes () |
disables all clip planes (needs a valid OpenGL context!) | |
static void | disableAllLights () |
disables all lights (needs a valid OpenGL context!) | |
static std::string | uniformTypeToString (GLenum type) |
Get uniform type as string. | |
static std::string | getUniformValue (GLint program, GLint uniform, GLenum type) |
Get uniform value as string. | |
static void | getActiveUniforms (GLuint program, std::vector< TypeInfo > &uniforms, bool withValues) |
Get the active uniforms from a shader. | |
static const char * | internalFormatToString (GLuint format) |
Returns the internal GL format as string;. | |
MeVis OpenGL Information Interface (Singleton)
MeVis OpenGL Information Interface (Singleton)
At MeVis we use the GLEW library, which is initialized in the init()
call of this class. In addition to the API provided by GLEW, this class has some additional methods that give information on the underlying OpenGL system. All methods of this class can be called WITHOUT having a valid OpenGL context, given that the init() method was called once at program startup. Projects that use the OpenGL API or extensions should typically specify
in their profile and include
This will also include the appropriate GLEW OpenGL header files.
Definition at line 58 of file mlOpenGL.h.
this method binds the 0 target to all texture units and ARB/GLSL shaders and it should be called in code that causes ATI OGL driver crashes when resources are freed in a shared context and have been previously bound in the original context (even if the state was popped afterwards) NOTE: needs a valid OpenGL context
disables all clip planes (needs a valid OpenGL context!)
|
static |
Get the active uniforms from a shader.
returns max size of a supported smooth line width
returns max available texture units (using GL_MAX_TEXTURE_IMAGE_UNITS)
returns max 2d texture size (using GL_MAX_TEXTURE_SIZE)
returns max 3d texture size (using GL_MAX_3D_TEXTURE_SIZE)
returns max available varying floats ( using GL_MAX_VARYING_FLOATS )
returns max available vertex attributes (using GL_MAX_VERTEX_ATTRIBS)
Get uniform value as string.
Returns the maximum available video memory size in MB.
This tries to use OpenGL extensions to detect the size that is available for OpenGL and has a fallback to use OS routines to detect the size. On the Mesa Software Renderer, 512 MB are returned as default value, since the renderer is quite slow and it does not make sense to use a large amount of video memory.
initialize the OpenGL information and GLEW, returns true if everything is ok
Returns the internal GL format as string;.
returns if the OpenGL driver is the Mesa software renderer (typically llvmpipe).
Definition at line 74 of file mlOpenGL.h.
check if the given extension is supported
returns if the OpenGL driver supports visible 10bit OpenGL contexts.
Definition at line 77 of file mlOpenGL.h.
Returns if rendering to 3D textures is supported by FrameBufferObjects.