X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglx%2Fglxcurrent.c;h=d1193265f904986ea88f681a9f63545aa6c68eae;hb=b2c6290b0140797d0e12dd5b358292289d43edc4;hp=7f47a42777115dc29a8e542cb08ea540c5acc49e;hpb=a385d18598b28bf935e4460b86ce3f9e095a8015;p=mesa.git diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index 7f47a427771..d1193265f90 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -145,7 +145,7 @@ __glXSetCurrentContextNull(void) #endif } -_X_EXPORT GLXContext +_GLX_PUBLIC GLXContext glXGetCurrentContext(void) { struct glx_context *cx = __glXGetCurrentContext(); @@ -158,7 +158,7 @@ glXGetCurrentContext(void) } } -_X_EXPORT GLXDrawable +_GLX_PUBLIC GLXDrawable glXGetCurrentDrawable(void) { struct glx_context *gc = __glXGetCurrentContext(); @@ -252,22 +252,34 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, __glXUnlock(); + /* The indirect vertex array state must to be initialised after we + * have setup the context, as it needs to query server attributes. + */ + if (gc && !gc->isDirect) { + __GLXattribute *state = gc->client_state_private; + if (state && state->array_state == NULL) { + glGetString(GL_EXTENSIONS); + glGetString(GL_VERSION); + __glXInitVertexArrayState(gc); + } + } + return GL_TRUE; } -_X_EXPORT Bool +_GLX_PUBLIC Bool glXMakeCurrent(Display * dpy, GLXDrawable draw, GLXContext gc) { return MakeContextCurrent(dpy, draw, draw, gc); } -_X_EXPORT +_GLX_PUBLIC GLX_ALIAS(Bool, glXMakeCurrentReadSGI, (Display * dpy, GLXDrawable d, GLXDrawable r, GLXContext ctx), (dpy, d, r, ctx), MakeContextCurrent) -_X_EXPORT +_GLX_PUBLIC GLX_ALIAS(Bool, glXMakeContextCurrent, (Display * dpy, GLXDrawable d, GLXDrawable r, GLXContext ctx), (dpy, d, r, ctx), MakeContextCurrent)