Skip to content
Snippets Groups Projects
Commit b47731f2 authored by Ian Romanick's avatar Ian Romanick
Browse files

Import fixes from X.org tree (Søren Sandmann <sandmann@redhat.com>).

parent bc6bf401
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment