- ctx = c->gl_ctx = _mesa_create_context( &v->mesa_visual,
- share_list ? share_list->gl_ctx : (GLcontext *) NULL,
- (void *) c, direct);
- if (!c->gl_ctx) {
+ mesaCtx = &(c->mesa);
+
+ /* Setup these pointers here since they're using for making the default
+ * and proxy texture objects. Actually, we don't really need to do
+ * this since we're using the default fallback functions which
+ * _mesa_initialize_context() would plug in if needed.
+ */
+ mesaCtx->Driver.NewTextureObject = _mesa_new_texture_object;
+ mesaCtx->Driver.DeleteTexture = _mesa_delete_texture_object;
+
+ if (!_mesa_initialize_context(mesaCtx, &v->mesa_visual,
+ share_list ? &(share_list->mesa) : (GLcontext *) NULL,
+ (void *) c, direct)) {