From e0d6c3ce54fae6be110053d0fa4d351584f72a97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Tue, 17 May 2011 20:39:02 +0100 Subject: [PATCH] Fix context sharing when replaying CGL. --- glretrace_cgl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/glretrace_cgl.cpp b/glretrace_cgl.cpp index 892dc0d..2d6d882 100644 --- a/glretrace_cgl.cpp +++ b/glretrace_cgl.cpp @@ -38,6 +38,7 @@ typedef std::map DrawableMap; typedef std::map ContextMap; static DrawableMap drawable_map; static ContextMap context_map; +static glws::Context *sharedContext = NULL; static glws::Drawable * @@ -65,7 +66,12 @@ getContext(unsigned long long ctx) { ContextMap::const_iterator it; it = context_map.find(ctx); if (it == context_map.end()) { - return (context_map[ctx] = ws->createContext(visual)); + glws::Context *context; + context_map[ctx] = context = ws->createContext(visual, sharedContext); + if (!sharedContext) { + sharedContext = context; + } + return context; } return it->second; -- 2.45.2