summaryrefslogtreecommitdiff
path: root/glws_glx.cpp
diff options
context:
space:
mode:
authorZack Rusin <zack@kde.org>2011-05-08 00:52:13 -0400
committerJosé Fonseca <jose.r.fonseca@gmail.com>2011-05-08 11:27:35 +0100
commitfc6ecc93915fec9a0784063476ed5c89aa43cc5f (patch)
treec8e0cef105df6677819ab1f6f0d351fbade0af54 /glws_glx.cpp
parente54f8a45f2f072b3e12d7eba04bfddfa4b8c77aa (diff)
Implement context sharing.
early support for sharing contexts.
Diffstat (limited to 'glws_glx.cpp')
-rw-r--r--glws_glx.cpp12
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);
}