return EGL_NO_CONTEXT;
}
- if (ctx->Base.ClientAPI != EGL_OPENGL_API) {
- _eglError(EGL_BAD_MATCH, "eglCreateContext(only OpenGL API supported)");
+ /* API-dependent context creation */
+ switch (ctx->Base.ClientAPI) {
+ case EGL_OPENGL_API:
+ /* create a softpipe context */
+ ctx->pipe = softpipe_create(xdrv->screen, xdrv->winsys, NULL);
+ /* Now do xlib / state tracker inits here */
+ _eglConfigToContextModesRec(conf, &visual);
+ ctx->Context = st_create_context(ctx->pipe, &visual, share_ctx);
+ break;
+ default:
+ _eglError(EGL_BAD_MATCH, "eglCreateContext(unsupported API)");
free(ctx);
return EGL_NO_CONTEXT;
}
- /* create a softpipe context */
- ctx->pipe = softpipe_create(xdrv->screen, xdrv->winsys, NULL);
-
- /* Now do xlib / state tracker inits here */
- _eglConfigToContextModesRec(conf, &visual);
- ctx->Context = st_create_context(ctx->pipe, &visual, share_ctx);
-
_eglSaveContext(&ctx->Base);
return _eglGetContextHandle(&ctx->Base);
context->Base.DeletePending = EGL_TRUE;
}
else {
- st_destroy_context(context->Context);
+ /* API-dependent clean-up */
+ switch (context->Base.ClientAPI) {
+ case EGL_OPENGL_API:
+ st_destroy_context(context->Context);
+ break;
+ default:
+ assert(0);
+ }
free(context);
}
return EGL_TRUE;