summaryrefslogtreecommitdiff
path: root/src/glx/x11/glxext.c
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2005-02-23 20:06:52 +0000
committerIan Romanick <idr@us.ibm.com>2005-02-23 20:06:52 +0000
commit365a0a7c153da53c5e4fb6433751f9dab9a16fa4 (patch)
tree0b6b6ec9e491f3ef4646988a45e7f687f2ba356b /src/glx/x11/glxext.c
parent2b1ec683d3501845c89fa3983c079cc96d6949fb (diff)
Missed the commit of glxext.c yesterday.
Fixed a flow control problem in glGet*v that could result in the display not being unlocked. This also resulted in refactoring a lot more code out of the glGet*v routines into get_array_data, which was renamed to get_client_data.
Diffstat (limited to 'src/glx/x11/glxext.c')
-rw-r--r--src/glx/x11/glxext.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index 397b390189..a827e448bc 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -1761,10 +1761,19 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
gc->currentDpy = dpy;
gc->currentDrawable = draw;
gc->currentReadable = read;
-#ifdef GLX_DIRECT_RENDERING
- if (gc->isDirect) reply.contextTag = -1;
-#endif
- gc->currentContextTag = reply.contextTag;
+
+ if ( ! gc->isDirect ) {
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+
+ gc->currentContextTag = reply.contextTag;
+ if ( state->array_state == NULL ) {
+ (void) glGetString( GL_EXTENSIONS );
+ __glXInitVertexArrayState(gc);
+ }
+ }
+ else {
+ gc->currentContextTag = -1;
+ }
} else {
__glXSetCurrentContext(&dummyContext);
#ifdef GLX_DIRECT_RENDERING