16 void TGLContextPrivate::RegisterContext(TGLContext *ctx)
19 fgContexts[ctx->fPimpl->fGLContext] = ctx;
25 void TGLContextPrivate::RemoveContext(TGLContext *ctx)
28 fgContexts.erase(ctx->fPimpl->fGLContext);
33 std::map<HGLRC, TGLContext *> TGLContextPrivate::fgContexts;
38 TGLContext *TGLContextPrivate::GetCurrentContext()
40 HGLRC glContext = wglGetCurrentContext();
41 std::map<HGLRC, TGLContext *>::const_iterator it = fgContexts.find(glContext);
43 if (it != fgContexts.end())
49 #elif defined(R__HAS_COCOA)
51 std::map<Handle_t, TGLContext *> TGLContextPrivate::fgContexts;
55 TGLContext *TGLContextPrivate::GetCurrentContext()
57 const Handle_t ctxID = gVirtualX->GetCurrentOpenGLContext();
59 assert(fgContexts.find(ctxID) != fgContexts.end() &&
"GetCurrentContext, context id is unknown");
60 return fgContexts[ctxID];
69 std::map<GLXContext, TGLContext *> TGLContextPrivate::fgContexts;
74 TGLContext *TGLContextPrivate::GetCurrentContext()
76 GLXContext glContext = glXGetCurrentContext();
77 std::map<GLXContext, TGLContext *>::const_iterator it = fgContexts.find(glContext);
79 if (it != fgContexts.end())