summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_context.c
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-06-23 17:40:49 +0800
committerChia-I Wu <olv@lunarg.com>2010-06-29 17:16:19 +0800
commit57c654324f5577d30c5239cd0c2c3eb7ad474143 (patch)
tree09a5809e93bc471fd5636e3d9d1a54e5359f7fb8 /src/mesa/state_tracker/st_context.c
parent982aba97c581bab0ff55dc9cae4164ab30dfbeae (diff)
st/mesa: Add support for multiple APIs.
Add st_gl_api_create_es1 and st_gl_api_create_es2 to create OpeGL ES 1.1 and OpenGL ES 2.0 contexts respectively.
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r--src/mesa/state_tracker/st_context.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 4b809b6114..7eb5f32611 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -153,7 +153,7 @@ st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
}
-struct st_context *st_create_context(struct pipe_context *pipe,
+struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,
const __GLcontextModes *visual,
struct st_context *share)
{
@@ -164,16 +164,7 @@ struct st_context *st_create_context(struct pipe_context *pipe,
memset(&funcs, 0, sizeof(funcs));
st_init_driver_functions(&funcs);
-#if FEATURE_GL
- ctx = _mesa_create_context_for_api(API_OPENGL,
- visual, shareCtx, &funcs, NULL);
-#elif FEATURE_ES1
- ctx = _mesa_create_context_for_api(API_OPENGLES,
- visual, shareCtx, &funcs, NULL);
-#elif FEATURE_ES2
- ctx = _mesa_create_context_for_api(API_OPENGLES2,
- visual, shareCtx, &funcs, NULL);
-#endif
+ ctx = _mesa_create_context_for_api(api, visual, shareCtx, &funcs, NULL);
/* XXX: need a capability bit in gallium to query if the pipe
* driver prefers DP4 or MUL/MAD for vertex transformation.