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 adabe14..8d72a83 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 623513d..3e2d9a6 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 d771093..9c90fe2 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 4b5870e..5832d1f 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