Detailed Description

Magnum context.

Provides access to version and extension information. Instance available through Context::current() is automatically created during construction of *Application classes in Platform namespace. You can safely assume that the instance is available during whole lifetime of *Application object. It's also possible to create the context without using any *Application class using Platform::Context subclass, see Platform support documentation for more information.

Command-line options

The context is configurable through command-line options, that are passed either from the Platform::*Application classes or from the Platform::Context class. Usage:

Similar to isExtensionSupported(), but checks also that the minimal required version of the extension is larger or equal to version. Useful mainly in shader compilation when the decisions depend on selected GLSL version, for example:

The engine internally tracks object bindings and other state to avoid redundant OpenGL calls. In some cases (e.g. when non-Magnum code makes GL calls) the internal tracker no longer reflects actual state and needs to be reset to avoid strange issues.

auto Magnum::Context::detectedDriver

(

)

Detect driver.

Tries to detect driver using various OpenGL state queries. Once the detection is done, the result is cached, repeated queries don't result in repeated GL calls. Used primarily for enabling driver-specific workarounds.