class
WindowlessGlxContextWindowless GLX context.
Contents
GL context using pure X11 and GLX, used in WindowlessGlxApplication. Does not have any default framebuffer. It is built if WITH_WINDOWLESSGLXAPPLICATION
is enabled in CMake.
Meant to be used when there is a need to manage (multiple) GL contexts manually. See Manually managing windowless contexts for more information. If no other application header is included, this class is also aliased to Platform::WindowlessGLContext
.
Public types
- class Configuration
- Configuration.
Constructors, destructors, conversion operators
- WindowlessGlxContext(const Configuration& configuration, GLContext* context = nullptr) explicit
- Constructor.
- WindowlessGlxContext(NoCreateT) explicit
- Construct without creating an OpenGL context.
- WindowlessGlxContext(const WindowlessGlxContext&) deleted
- Copying is not allowed.
- WindowlessGlxContext(WindowlessGlxContext&& other)
- Move constructor.
- ~WindowlessGlxContext()
- Destructor.
Public functions
- auto operator=(const WindowlessGlxContext&) -> WindowlessGlxContext& deleted
- Copying is not allowed.
- auto operator=(WindowlessGlxContext&& other) -> WindowlessGlxContext&
- Move assignment.
- auto isCreated() const -> bool
- Whether the context is created.
- auto makeCurrent() -> bool
- Make the context current.
Function documentation
Magnum:: Platform:: WindowlessGlxContext:: WindowlessGlxContext(const Configuration& configuration,
GLContext* context = nullptr) explicit
Constructor.
Parameters | |
---|---|
configuration | Context configuration |
context | Optional Magnum context instance constructed using NoCreate to manage driver workarounds |
On desktop GL, if version is not specified in configuration
, the application first tries to create core context (OpenGL 3.1+) and if that fails, falls back to compatibility OpenGL 2.1 context. However, on binary AMD and NVidia drivers, creating core context does not use the largest available version. If the application detects such case (and given workaround is not disabled in optionally passed context
instance), the core context is destroyed and compatibility OpenGL 2.1 context is created instead to make the driver use the latest available version.
Once the context is created, make it current using makeCurrent() and create Platform::
Magnum:: Platform:: WindowlessGlxContext:: WindowlessGlxContext(NoCreateT) explicit
Construct without creating an OpenGL context.
Move a instance with created context over to make it usable.
Magnum:: Platform:: WindowlessGlxContext:: ~WindowlessGlxContext()
Destructor.
Destroys the context, if any.
bool Magnum:: Platform:: WindowlessGlxContext:: makeCurrent()
Make the context current.
Prints error message and returns false
on failure, otherwise returns true
.