aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_manager.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-12-25 17:27:22 +0100
committerMarc Haesen <marc@hc-consult.be>2011-12-25 17:27:22 +0100
commit0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1 (patch)
treed449668fac922e358f442aeb82d0936ca786ed72 /mesalib/src/mesa/state_tracker/st_manager.c
parent0b3f475361d87764004432f541e34bb86af1b9f3 (diff)
downloadvcxsrv-0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1.tar.gz
vcxsrv-0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1.tar.bz2
vcxsrv-0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1.zip
mesa xkeyboard-config xserver git update 25 dec 2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_manager.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_manager.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_manager.c b/mesalib/src/mesa/state_tracker/st_manager.c
index 55699e721..828f0d81f 100644
--- a/mesalib/src/mesa/state_tracker/st_manager.c
+++ b/mesalib/src/mesa/state_tracker/st_manager.c
@@ -600,6 +600,7 @@ st_context_destroy(struct st_context_iface *stctxi)
static struct st_context_iface *
st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
const struct st_context_attribs *attribs,
+ enum st_context_error *error,
struct st_context_iface *shared_stctxi)
{
struct st_context *shared_ctx = (struct st_context *) shared_stctxi;
@@ -623,17 +624,21 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
break;
case ST_PROFILE_OPENGL_CORE:
default:
+ *error = ST_CONTEXT_ERROR_BAD_API;
return NULL;
break;
}
pipe = smapi->screen->context_create(smapi->screen, NULL);
- if (!pipe)
+ if (!pipe) {
+ *error = ST_CONTEXT_ERROR_NO_MEMORY;
return NULL;
+ }
st_visual_to_context_mode(&attribs->visual, &mode);
st = st_create_context(api, pipe, &mode, shared_ctx);
if (!st) {
+ *error = ST_CONTEXT_ERROR_NO_MEMORY;
pipe->destroy(pipe);
return NULL;
}
@@ -645,6 +650,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
/* is the actual version less than the requested version? */
if (st->ctx->VersionMajor * 10 + st->ctx->VersionMinor <
attribs->major * 10 + attribs->minor) {
+ *error = ST_CONTEXT_ERROR_BAD_VERSION;
st_destroy_context(st);
return NULL;
}
@@ -660,6 +666,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
st->iface.share = st_context_share;
st->iface.st_context_private = (void *) smapi;
+ *error = ST_CONTEXT_SUCCESS;
return &st->iface;
}