From 4531356817ec8383ac35932903773de67af92e37 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 10 Sep 2010 10:31:06 +0800 Subject: gallium: Add context profile support to st_api. Add struct st_context_attribs to describe context profiles and attributes. Modify st_api::create_context to take the new struct instead of an st_visual. st_context_attribs can be used to support GLX_ARB_create_context_profile and GLX_EXT_create_context_es2_profile in the future. But the motivation for doing it now is to be able to replace ST_API_OPENGL_ES1 and ST_API_OPENGL_ES2 by profiles. Having 3 st_api's to provide OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is not a sane abstraction, since all of them share glapi for current context/dispatch management. --- src/gallium/state_trackers/wgl/stw_context.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gallium/state_trackers/wgl') diff --git a/src/gallium/state_trackers/wgl/stw_context.c b/src/gallium/state_trackers/wgl/stw_context.c index a0e14b9601..85878b4673 100644 --- a/src/gallium/state_trackers/wgl/stw_context.c +++ b/src/gallium/state_trackers/wgl/stw_context.c @@ -129,6 +129,7 @@ DrvCreateLayerContext( { int iPixelFormat; const struct stw_pixelformat_info *pfi; + struct st_context_attribs attribs; struct stw_context *ctx = NULL; if(!stw_dev) @@ -150,8 +151,12 @@ DrvCreateLayerContext( ctx->hdc = hdc; ctx->iPixelFormat = iPixelFormat; + memset(&attribs, 0, sizeof(attribs)); + attribs.profile = ST_PROFILE_DEFAULT; + attribs.visual = pfi->stvis; + ctx->st = stw_dev->stapi->create_context(stw_dev->stapi, - stw_dev->smapi, &pfi->stvis, NULL); + stw_dev->smapi, &attribs, NULL); if (ctx->st == NULL) goto no_st_ctx; -- cgit v1.2.3