diff options
author | Ian Romanick <[email protected]> | 2005-03-04 17:53:24 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2005-03-04 17:53:24 +0000 |
commit | b47731f24db2e4c99073b107050376addf636c98 (patch) | |
tree | 27ecf0cc4d0bd7b0569583078a8c7a161a400536 /src/glx | |
parent | bc6bf401f54ffaf0330de6e6b5ba37eff7354119 (diff) |
Import fixes from X.org tree (Søren Sandmann <[email protected]>).
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/x11/glx_pbuffer.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/glx/x11/glx_pbuffer.c b/src/glx/x11/glx_pbuffer.c index a7d9f122cb0..b515f0c8395 100644 --- a/src/glx/x11/glx_pbuffer.c +++ b/src/glx/x11/glx_pbuffer.c @@ -278,14 +278,16 @@ CreateDrawable( Display *dpy, const __GLcontextModes * fbconfig, { xGLXCreateWindowReq * req; CARD32 * data; - unsigned int i; - + unsigned int i; - for ( i = 0 ; attrib_list[i * 2] != None ; i++ ) - /* empty */ ; + i = 0; + if (attrib_list) { + while (attrib_list[i * 2] != None) + i++; + } LockDisplay(dpy); - GetReqExtra( GLXCreateWindow, 20 + (8 * i), req ); + GetReqExtra( GLXCreateWindow, 8 * i, req ); data = (CARD32 *) (req + 1); req->reqType = __glXSetupForCommand(dpy); @@ -293,12 +295,15 @@ CreateDrawable( Display *dpy, const __GLcontextModes * fbconfig, req->screen = (CARD32) fbconfig->screen; req->fbconfig = fbconfig->fbconfigID; req->window = (GLXPbuffer) drawable; + req->glxwindow = (GLXWindow) XAllocID(dpy); req->numAttribs = (CARD32) i; + memcpy( data, attrib_list, 8 * i ); + UnlockDisplay(dpy); SyncHandle(); - return drawable; + return (GLXDrawable)req->glxwindow; } @@ -355,10 +360,11 @@ CreatePbuffer( Display *dpy, const __GLcontextModes * fbconfig, CARD32 * data; unsigned int i; - - for ( i = 0 ; attrib_list[i * 2] != None ; i++ ) - /* empty */ ; - + i = 0; + if (attrib_list) { + while (attrib_list[i * 2]) + i++; + } LockDisplay(dpy); id = XAllocID(dpy); |