diff options
author | Zack Rusin <zack@kde.org> | 2011-05-08 00:52:13 -0400 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2011-05-08 11:27:35 +0100 |
commit | fc6ecc93915fec9a0784063476ed5c89aa43cc5f (patch) | |
tree | c8e0cef105df6677819ab1f6f0d351fbade0af54 /glws_glx.cpp | |
parent | e54f8a45f2f072b3e12d7eba04bfddfa4b8c77aa (diff) |
Implement context sharing.
early support for sharing contexts.
Diffstat (limited to 'glws_glx.cpp')
-rw-r--r-- | glws_glx.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/glws_glx.cpp b/glws_glx.cpp index 39e0c468..732f33d1 100644 --- a/glws_glx.cpp +++ b/glws_glx.cpp @@ -190,10 +190,18 @@ public: } Context * - createContext(const Visual *visual) + createContext(const Visual *visual, Context *shareContext) { XVisualInfo *visinfo = dynamic_cast<const GlxVisual *>(visual)->visinfo; - GLXContext context = glXCreateContext(display, visinfo, NULL, True); + GLXContext share_context = NULL; + GLXContext context; + + if (shareContext) { + share_context = dynamic_cast<GlxContext*>(shareContext)->context; + } + + context = glXCreateContext(display, visinfo, + share_context, True); return new GlxContext(visual, context); } |