|
Ream v0.1.0-1
C++ graphics library for Linux
|
RAII guard for scoped eglMakeCurrent() calls.
More...
#include <RGLMakeCurrent.h>
Public Member Functions | |
| RGLMakeCurrent () noexcept | |
| Captures the current EGL binding without changing it. | |
| RGLMakeCurrent (EGLDisplay display, EGLSurface draw, EGLSurface read, EGLContext context) noexcept | |
| Captures the current EGL binding and makes the given one current. | |
| ~RGLMakeCurrent () noexcept | |
| Restores the captured EGL binding. | |
| bool | restore () noexcept |
| Restores the EGL binding captured at construction. | |
Static Public Member Functions | |
| static RGLMakeCurrent | FromDevice (RGLDevice *device, bool keepSurfaces) noexcept |
| Creates a guard that makes the given device's context current on the calling thread. | |
RAII guard for scoped eglMakeCurrent() calls.
On construction it captures the currently bound EGL display, draw/read surfaces, and context, then optionally binds a new context. On destruction (or an explicit restore()) it re-binds the previously captured state. This is used throughout the GL backend to temporarily make a device's context current on the calling thread without disturbing the caller's own binding.
|
inlinenoexcept |
Captures the current EGL binding without changing it.
Useful to snapshot and later restore() the current context.
|
inlinenoexcept |
Captures the current EGL binding and makes the given one current.
| display | The EGL display to bind. |
| draw | The draw surface to bind. |
| read | The read surface to bind. |
| context | The context to make current. |
|
inlinenoexcept |
Restores the captured EGL binding.
|
staticnoexcept |
Creates a guard that makes the given device's context current on the calling thread.
| device | The device whose per-thread EGL context should be made current. |
| keepSurfaces | If true and the device's display is already current, the currently bound draw/read surfaces are preserved; otherwise the context is bound surfaceless. |
|
noexcept |
Restores the EGL binding captured at construction.
Has no effect if already restored (either by a prior call or by the destructor).
true if the state was restored by this call, false if it had already been restored.