80 wxCHECK( aContext &&
m_glContexts.count( aContext ) > 0, );
83 wxGLCanvas* canvas = aCanvas ? aCanvas :
m_glContexts.at( aContext );
89 if( canvas->GTKGetDrawingWindow() )
91 if( canvas->GetXWindow() )
96 canvas->SetCurrent( *aContext );
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.
void LockCtx(wxGLContext *aContext, wxGLCanvas *aCanvas)
Set a context as current and prevents other canvases from switching it.
std::map< wxGLContext *, wxGLCanvas * > m_glContexts
< Map of GL contexts & their parent canvases.
wxGLContext * CreateCtx(wxGLCanvas *aCanvas, const wxGLContext *aOther=nullptr)
Create a managed OpenGL context.
void DeleteAll()
Destroy all managed OpenGL contexts.