From e4d895bd5825190ec6ab221ff7993015672ed4c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Mon, 28 Nov 2011 21:48:58 +0000 Subject: [PATCH] Cache context profile in glws::Context. --- glws.hpp | 6 ++++-- glws_egl_xlib.cpp | 6 +++--- glws_glx.cpp | 6 +++--- glws_wgl.cpp | 6 +++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/glws.hpp b/glws.hpp index adabe14..8d72a83 100644 --- 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() {} diff --git a/glws_egl_xlib.cpp b/glws_egl_xlib.cpp index 623513d..3e2d9a6 100644 --- a/glws_egl_xlib.cpp +++ b/glws_egl_xlib.cpp @@ -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 diff --git a/glws_glx.cpp b/glws_glx.cpp index d771093..9c90fe2 100644 --- a/glws_glx.cpp +++ b/glws_glx.cpp @@ -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 diff --git a/glws_wgl.cpp b/glws_wgl.cpp index 4b5870e..5832d1f 100644 --- a/glws_wgl.cpp +++ b/glws_wgl.cpp @@ -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(shareContext)); + return new WglContext(visual, profile, dynamic_cast(shareContext)); } bool -- 2.7.4