]> git.cworth.org Git - apitrace/commitdiff
Cache context profile in glws::Context.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 28 Nov 2011 21:48:58 +0000 (21:48 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 28 Nov 2011 21:48:58 +0000 (21:48 +0000)
glws.hpp
glws_egl_xlib.cpp
glws_glx.cpp
glws_wgl.cpp

index adabe14dd8038a415e8430b9c8a68f5deb0f7337..8d72a83357666174d435d7cb2180cf988e05163a 100644 (file)
--- a/glws.hpp
+++ b/glws.hpp
@@ -129,9 +129,11 @@ class Context
 {
 public:
     const Visual *visual;
+    Profile profile;
     
-    Context(const Visual *vis) :
-        visual(vis)
+    Context(const Visual *vis, Profile prof) :
+        visual(vis),
+        profile(prof)
     {}
 
     virtual ~Context() {}
index 623513ddd5dc4d20ef741aa3b4346a9bbbbae35f..3e2d9a617cbd5b0a0066a8596d5ed67a9c2eb79c 100644 (file)
@@ -209,8 +209,8 @@ class EglContext : public Context
 public:
     EGLContext context;
 
-    EglContext(const Visual *vis, EGLContext ctx) :
-        Context(vis),
+    EglContext(const Visual *vis, Profile prof, EGLContext ctx) :
+        Context(vis, prof),
         context(ctx)
     {}
 
@@ -339,7 +339,7 @@ createContext(const Visual *_visual, Context *shareContext, Profile profile)
 
     eglBindAPI(api);
 
-    return new EglContext(visual, context);
+    return new EglContext(visual, profile, context);
 }
 
 bool
index d771093b430b80ec343b8be0e93bf341781da0d0..9c90fe2b09b387e50ec1e6f7250f1e1bd1b50d4a 100644 (file)
@@ -205,8 +205,8 @@ class GlxContext : public Context
 public:
     GLXContext context;
 
-    GlxContext(const Visual *vis, GLXContext ctx) :
-        Context(vis),
+    GlxContext(const Visual *vis, Profile prof, GLXContext ctx) :
+        Context(vis, prof),
         context(ctx)
     {}
 
@@ -323,7 +323,7 @@ createContext(const Visual *_visual, Context *shareContext, Profile profile)
         context = glXCreateContext(display, visual->visinfo, share_context, True);
     }
 
-    return new GlxContext(visual, context);
+    return new GlxContext(visual, profile, context);
 }
 
 bool
index 4b5870ef75c97378967ebeb02f22c6245849b2bd..5832d1fa18ed2696ef633527632f07e6ea913a7d 100644 (file)
@@ -172,8 +172,8 @@ public:
     HGLRC hglrc;
     WglContext *shareContext;
 
-    WglContext(const Visual *vis, WglContext *share) :
-        Context(vis),
+    WglContext(const Visual *vis, Profile prof, WglContext *share) :
+        Context(vis, prof),
         hglrc(0),
         shareContext(share)
     {}
@@ -216,7 +216,7 @@ createContext(const Visual *visual, Context *shareContext, Profile profile)
         return NULL;
     }
 
-    return new WglContext(visual, dynamic_cast<WglContext *>(shareContext));
+    return new WglContext(visual, profile, dynamic_cast<WglContext *>(shareContext));
 }
 
 bool