void UnlockCtx(wxGLContext *aContext)
Allow other canvases to bind an OpenGL context.
wxGLContext * m_glCtx
Lock to prevent unexpected GL context switching.
void DestroyCtx(wxGLContext *aContext)
Destroy a managed OpenGL context.
GL_CONTEXT_MANAGER(const GL_CONTEXT_MANAGER &)
void LockCtx(wxGLContext *aContext, wxGLCanvas *aCanvas)
Set a context as current and prevents other canvases from switching it.
static GL_CONTEXT_MANAGER & Get()
Return the GL_CONTEXT_MANAGER instance (singleton).
std::map< wxGLContext *, wxGLCanvas * > m_glContexts
< Map of GL contexts & their parent canvases.
void operator=(const GL_CONTEXT_MANAGER &)
wxGLContext * CreateCtx(wxGLCanvas *aCanvas, const wxGLContext *aOther=nullptr)
Create a managed OpenGL context.
void DeleteAll()
Destroy all managed OpenGL contexts.