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 () |
Initializes the OpenGL information and GLEW, returns true if everything is ok. More... | |
static const std::string & | getVendorString () |
Returns the OpenGL vendor string. More... | |
static const std::string & | getRendererString () |
Returns the OpenGL driver string. More... | |
static const std::string & | getVersionString () |
Return the OpenGL version string. More... | |
static bool | isMesaSoftwareRenderer () |
Returns whether the OpenGL driver is the Mesa software renderer (typically llvmpipe). More... | |
static bool | supports10Bit () |
Returns whether the OpenGL driver supports visible 10-bit OpenGL contexts. More... | |
static bool | supportsRenderTo3DTexture () |
Returns whether rendering to 3D textures is supported by FrameBufferObjects. More... | |
static bool | supportsPBO () |
Returns whether PixelBufferObjects are supported. More... | |
static GLint | getVideoMemorySizeInMB () |
Returns the maximum available video memory size in MB. More... | |
static GLint | getMaxTextureSize () |
Returns the maximum 2D texture size (using GL_MAX_TEXTURE_SIZE). More... | |
static GLint | getMaxTextureSize3D () |
Returns the maximum 3D texture size (using GL_MAX_3D_TEXTURE_SIZE). More... | |
static GLint | getMaxTextureImageUnits () |
Returns the maximum available texture units (using GL_MAX_TEXTURE_IMAGE_UNITS). More... | |
static GLint | getMaxVertexAttributes () |
Returns the maximum available vertex attributes (using GL_MAX_VERTEX_ATTRIBS). More... | |
static GLint | getMaxVaryingFloats () |
Returns the maximum available varying floats (using GL_MAX_VARYING_FLOATS). More... | |
static GLint | getMaxSmoothLineWidth () |
Returns the maximum size of a supported smooth line width. More... | |
static GLint | getMaxClipPlanes () |
Returns the maximum number of clip planes. More... | |
static GLint | getMaxLights () |
Returns the maximum number of lights. More... | |
static bool | isSupported (const char *extension) |
Checks whether the given extension is supported. More... | |
static void | clearTextureUnitsAndShaders () |
This method binds the 0 target to all texture units and ARB/GLSL shaders. More... | |
static void | disableAllClipPlanes () |
Disables all clip planes (needs a valid OpenGL context!). More... | |
static void | disableAllLights () |
Disables all lights (needs a valid OpenGL context!). More... | |
static std::string | uniformTypeToString (GLenum type) |
Returns the uniform type as string. More... | |
static std::string | getUniformValue (GLint program, GLint uniform, GLenum type) |
Returns the uniform value as string. More... | |
static void | getActiveUniforms (GLuint program, std::vector< TypeInfo > &uniforms, bool withValues) |
Returns the active uniforms from a shader. More... | |
static const char * | internalFormatToString (GLuint format) |
Returns the internal GL format as string;. More... | |
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 methods that provide 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.
|
static |
This method binds the 0 target to all texture units and ARB/GLSL shaders.
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 |
Disables all clip planes (needs a valid OpenGL context!).
|
static |
Disables all lights (needs a valid OpenGL context!).
|
static |
Returns the active uniforms from a shader.
|
static |
Returns the maximum number of clip planes.
|
static |
Returns the maximum number of lights.
|
static |
Returns the maximum size of a supported smooth line width.
|
static |
Returns the maximum available texture units (using GL_MAX_TEXTURE_IMAGE_UNITS).
|
static |
Returns the maximum 2D texture size (using GL_MAX_TEXTURE_SIZE).
|
static |
Returns the maximum 3D texture size (using GL_MAX_3D_TEXTURE_SIZE).
|
static |
Returns the maximum available varying floats (using GL_MAX_VARYING_FLOATS).
|
static |
Returns the maximum available vertex attributes (using GL_MAX_VERTEX_ATTRIBS).
|
static |
Returns the OpenGL driver string.
|
static |
Returns the uniform value as string.
|
static |
Returns the OpenGL vendor string.
|
static |
Return the OpenGL version string.
|
static |
Returns the maximum available video memory size in MB.
This attempts to use OpenGL extensions to detect the available size for OpenGL and has a fallback to use OS routines to detect the actual size. On the Mesa software renderer, 512 MB is returned as a default value, since the renderer is quite slow and it does not make sense to use a large amount of video memory.
|
static |
Initializes the OpenGL information and GLEW, returns true
if everything is ok.
|
static |
Returns the internal GL format as string;.
|
inlinestatic |
Returns whether the OpenGL driver is the Mesa software renderer (typically llvmpipe).
Definition at line 74 of file mlOpenGL.h.
|
static |
Checks whether the given extension is supported.
|
inlinestatic |
Returns whether the OpenGL driver supports visible 10-bit OpenGL contexts.
Definition at line 77 of file mlOpenGL.h.
|
static |
Returns whether PixelBufferObjects are supported.
|
static |
Returns whether rendering to 3D textures is supported by FrameBufferObjects.
|
static |
Returns the uniform type as string.