MeVisLab Toolbox Reference
OpenGL Class 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 charinternalFormatToString (GLuint format)
 Returns the internal GL format as string;.
 

Detailed Description

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

Target mlrange_cast(Source arg)
Generic version of checked ML casts.

in their profile and include

This will also include the appropriate GLEW OpenGL header files.

See also
GLEW documentation at http://glew.sourceforge.net/

Definition at line 58 of file mlOpenGL.h.

Member Function Documentation

◆ clearTextureUnitsAndShaders()

static void OpenGL::clearTextureUnitsAndShaders ( )
static

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

◆ disableAllClipPlanes()

static void OpenGL::disableAllClipPlanes ( )
static

disables all clip planes (needs a valid OpenGL context!)

◆ disableAllLights()

static void OpenGL::disableAllLights ( )
static

disables all lights (needs a valid OpenGL context!)

◆ getActiveUniforms()

static void OpenGL::getActiveUniforms ( GLuint program,
std::vector< TypeInfo > & uniforms,
bool withValues )
static

Get the active uniforms from a shader.

◆ getMaxClipPlanes()

static GLint OpenGL::getMaxClipPlanes ( )
static

returns max number of clip planes

◆ getMaxLights()

static GLint OpenGL::getMaxLights ( )
static

returns max number of lights

◆ getMaxSmoothLineWidth()

static GLint OpenGL::getMaxSmoothLineWidth ( )
static

returns max size of a supported smooth line width

◆ getMaxTextureImageUnits()

static GLint OpenGL::getMaxTextureImageUnits ( )
static

returns max available texture units (using GL_MAX_TEXTURE_IMAGE_UNITS)

◆ getMaxTextureSize()

static GLint OpenGL::getMaxTextureSize ( )
static

returns max 2d texture size (using GL_MAX_TEXTURE_SIZE)

◆ getMaxTextureSize3D()

static GLint OpenGL::getMaxTextureSize3D ( )
static

returns max 3d texture size (using GL_MAX_3D_TEXTURE_SIZE)

◆ getMaxVaryingFloats()

static GLint OpenGL::getMaxVaryingFloats ( )
static

returns max available varying floats ( using GL_MAX_VARYING_FLOATS )

◆ getMaxVertexAttributes()

static GLint OpenGL::getMaxVertexAttributes ( )
static

returns max available vertex attributes (using GL_MAX_VERTEX_ATTRIBS)

◆ getRendererString()

static const std::string & OpenGL::getRendererString ( )
static

get the open gl driver string

◆ getUniformValue()

static std::string OpenGL::getUniformValue ( GLint program,
GLint uniform,
GLenum type )
static

Get uniform value as string.

◆ getVendorString()

static const std::string & OpenGL::getVendorString ( )
static

get the open gl vendor string

◆ getVersionString()

static const std::string & OpenGL::getVersionString ( )
static

get the open gl version string

◆ getVideoMemorySizeInMB()

static GLint OpenGL::getVideoMemorySizeInMB ( )
static

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.

◆ init()

static bool OpenGL::init ( )
static

initialize the OpenGL information and GLEW, returns true if everything is ok

◆ internalFormatToString()

static const char * OpenGL::internalFormatToString ( GLuint format)
static

Returns the internal GL format as string;.

◆ isMesaSoftwareRenderer()

static bool OpenGL::isMesaSoftwareRenderer ( )
inlinestatic

returns if the OpenGL driver is the Mesa software renderer (typically llvmpipe).

Definition at line 74 of file mlOpenGL.h.

◆ isSupported()

static bool OpenGL::isSupported ( const char * extension)
static

check if the given extension is supported

◆ supports10Bit()

static bool OpenGL::supports10Bit ( )
inlinestatic

returns if the OpenGL driver supports visible 10bit OpenGL contexts.

Definition at line 77 of file mlOpenGL.h.

◆ supportsPBO()

static bool OpenGL::supportsPBO ( )
static

Returns if PixelBufferObjects are supported.

◆ supportsRenderTo3DTexture()

static bool OpenGL::supportsRenderTo3DTexture ( )
static

Returns if rendering to 3D textures is supported by FrameBufferObjects.

◆ uniformTypeToString()

static std::string OpenGL::uniformTypeToString ( GLenum type)
static

Get uniform type as string.


The documentation for this class was generated from the following file: