2 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice including the dates of first publication and
13 * either this permission notice or a reference to
14 * http://oss.sgi.com/projects/FreeB/
15 * shall be included in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
22 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * Except as contained in this notice, the name of Silicon Graphics, Inc.
26 * shall not be used in advertising or otherwise to promote the sale, use or
27 * other dealings in this Software without prior written authorization from
28 * Silicon Graphics, Inc.
31 #ifdef HAVE_DIX_CONFIG_H
32 #include <dix-config.h>
36 #include "glxserver.h"
38 #include <GL/glxtokens.h>
40 #include "g_disptab.h"
41 #include <pixmapstr.h>
42 #include <windowstr.h>
44 #include "glapitable.h"
48 #include "indirect_dispatch.h"
49 #include "indirect_table.h"
50 #include "indirect_util.h"
53 /************************************************************************/
56 ** Byteswapping versions of GLX commands. In most cases they just swap
57 ** the incoming arguments and then call the unswapped routine. For commands
58 ** that have replies, a separate swapping routine for the reply is provided;
59 ** it is called at the end of the unswapped routine.
62 int __glXDispSwap_CreateContext(__GLXclientState *cl, GLbyte *pc)
64 xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
65 __GLX_DECLARE_SWAP_VARIABLES;
67 __GLX_SWAP_SHORT(&req->length);
68 __GLX_SWAP_INT(&req->context);
69 __GLX_SWAP_INT(&req->visual);
70 __GLX_SWAP_INT(&req->screen);
71 __GLX_SWAP_INT(&req->shareList);
73 return __glXDisp_CreateContext(cl, pc);
76 int __glXDispSwap_CreateNewContext(__GLXclientState *cl, GLbyte *pc)
78 xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
79 __GLX_DECLARE_SWAP_VARIABLES;
81 __GLX_SWAP_SHORT(&req->length);
82 __GLX_SWAP_INT(&req->context);
83 __GLX_SWAP_INT(&req->fbconfig);
84 __GLX_SWAP_INT(&req->screen);
85 __GLX_SWAP_INT(&req->renderType);
86 __GLX_SWAP_INT(&req->shareList);
88 return __glXDisp_CreateNewContext(cl, pc);
91 int __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
93 xGLXCreateContextWithConfigSGIXReq *req =
94 (xGLXCreateContextWithConfigSGIXReq *) pc;
95 __GLX_DECLARE_SWAP_VARIABLES;
97 __GLX_SWAP_SHORT(&req->length);
98 __GLX_SWAP_INT(&req->context);
99 __GLX_SWAP_INT(&req->fbconfig);
100 __GLX_SWAP_INT(&req->screen);
101 __GLX_SWAP_INT(&req->renderType);
102 __GLX_SWAP_INT(&req->shareList);
104 return __glXDisp_CreateContextWithConfigSGIX(cl, pc);
107 int __glXDispSwap_DestroyContext(__GLXclientState *cl, GLbyte *pc)
109 xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
110 __GLX_DECLARE_SWAP_VARIABLES;
112 __GLX_SWAP_SHORT(&req->length);
113 __GLX_SWAP_INT(&req->context);
115 return __glXDisp_DestroyContext(cl, pc);
118 int __glXDispSwap_MakeCurrent(__GLXclientState *cl, GLbyte *pc)
120 xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
121 __GLX_DECLARE_SWAP_VARIABLES;
123 __GLX_SWAP_SHORT(&req->length);
124 __GLX_SWAP_INT(&req->drawable);
125 __GLX_SWAP_INT(&req->context);
126 __GLX_SWAP_INT(&req->oldContextTag);
128 return __glXDisp_MakeCurrent(cl, pc);
131 int __glXDispSwap_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
133 xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
134 __GLX_DECLARE_SWAP_VARIABLES;
136 __GLX_SWAP_SHORT(&req->length);
137 __GLX_SWAP_INT(&req->drawable);
138 __GLX_SWAP_INT(&req->readdrawable);
139 __GLX_SWAP_INT(&req->context);
140 __GLX_SWAP_INT(&req->oldContextTag);
142 return __glXDisp_MakeContextCurrent(cl, pc);
145 int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
147 xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
148 __GLX_DECLARE_SWAP_VARIABLES;
150 __GLX_SWAP_SHORT(&req->length);
151 __GLX_SWAP_INT(&req->drawable);
152 __GLX_SWAP_INT(&req->readable);
153 __GLX_SWAP_INT(&req->context);
154 __GLX_SWAP_INT(&req->oldContextTag);
156 return __glXDisp_MakeCurrentReadSGI(cl, pc);
159 int __glXDispSwap_IsDirect(__GLXclientState *cl, GLbyte *pc)
161 xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
162 __GLX_DECLARE_SWAP_VARIABLES;
164 __GLX_SWAP_SHORT(&req->length);
165 __GLX_SWAP_INT(&req->context);
167 return __glXDisp_IsDirect(cl, pc);
170 int __glXDispSwap_QueryVersion(__GLXclientState *cl, GLbyte *pc)
172 xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
173 __GLX_DECLARE_SWAP_VARIABLES;
175 __GLX_SWAP_SHORT(&req->length);
176 __GLX_SWAP_INT(&req->majorVersion);
177 __GLX_SWAP_INT(&req->minorVersion);
179 return __glXDisp_QueryVersion(cl, pc);
182 int __glXDispSwap_WaitGL(__GLXclientState *cl, GLbyte *pc)
184 xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
185 __GLX_DECLARE_SWAP_VARIABLES;
187 __GLX_SWAP_SHORT(&req->length);
188 __GLX_SWAP_INT(&req->contextTag);
190 return __glXDisp_WaitGL(cl, pc);
193 int __glXDispSwap_WaitX(__GLXclientState *cl, GLbyte *pc)
195 xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
196 __GLX_DECLARE_SWAP_VARIABLES;
198 __GLX_SWAP_SHORT(&req->length);
199 __GLX_SWAP_INT(&req->contextTag);
201 return __glXDisp_WaitX(cl, pc);
204 int __glXDispSwap_CopyContext(__GLXclientState *cl, GLbyte *pc)
206 xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
207 __GLX_DECLARE_SWAP_VARIABLES;
209 __GLX_SWAP_SHORT(&req->length);
210 __GLX_SWAP_INT(&req->source);
211 __GLX_SWAP_INT(&req->dest);
212 __GLX_SWAP_INT(&req->mask);
214 return __glXDisp_CopyContext(cl, pc);
217 int __glXDispSwap_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
219 xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
220 __GLX_DECLARE_SWAP_VARIABLES;
222 __GLX_SWAP_INT(&req->screen);
223 return __glXDisp_GetVisualConfigs(cl, pc);
226 int __glXDispSwap_GetFBConfigs(__GLXclientState *cl, GLbyte *pc)
228 xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
229 __GLX_DECLARE_SWAP_VARIABLES;
231 __GLX_SWAP_INT(&req->screen);
232 return __glXDisp_GetFBConfigs(cl, pc);
235 int __glXDispSwap_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
237 xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
238 __GLX_DECLARE_SWAP_VARIABLES;
240 __GLX_SWAP_INT(&req->screen);
241 return __glXDisp_GetFBConfigsSGIX(cl, pc);
244 int __glXDispSwap_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
246 xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
247 __GLX_DECLARE_SWAP_VARIABLES;
249 __GLX_SWAP_SHORT(&req->length);
250 __GLX_SWAP_INT(&req->screen);
251 __GLX_SWAP_INT(&req->visual);
252 __GLX_SWAP_INT(&req->pixmap);
253 __GLX_SWAP_INT(&req->glxpixmap);
255 return __glXDisp_CreateGLXPixmap(cl, pc);
258 int __glXDispSwap_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
260 xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
262 __GLX_DECLARE_SWAP_VARIABLES;
263 __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
265 __GLX_SWAP_SHORT(&req->length);
266 __GLX_SWAP_INT(&req->screen);
267 __GLX_SWAP_INT(&req->fbconfig);
268 __GLX_SWAP_INT(&req->pixmap);
269 __GLX_SWAP_INT(&req->glxpixmap);
270 __GLX_SWAP_INT(&req->numAttribs);
271 attribs = (CARD32*)(req + 1);
272 __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
274 return __glXDisp_CreatePixmap(cl, pc);
277 int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
279 xGLXCreateGLXPixmapWithConfigSGIXReq *req =
280 (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
281 __GLX_DECLARE_SWAP_VARIABLES;
283 __GLX_SWAP_SHORT(&req->length);
284 __GLX_SWAP_INT(&req->screen);
285 __GLX_SWAP_INT(&req->fbconfig);
286 __GLX_SWAP_INT(&req->pixmap);
287 __GLX_SWAP_INT(&req->glxpixmap);
289 return __glXDisp_CreateGLXPixmapWithConfigSGIX(cl, pc);
292 int __glXDispSwap_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
294 xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
295 __GLX_DECLARE_SWAP_VARIABLES;
297 __GLX_SWAP_SHORT(&req->length);
298 __GLX_SWAP_INT(&req->glxpixmap);
300 return __glXDisp_DestroyGLXPixmap(cl, pc);
303 int __glXDispSwap_DestroyPixmap(__GLXclientState *cl, GLbyte *pc)
305 xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
306 __GLX_DECLARE_SWAP_VARIABLES;
308 __GLX_SWAP_SHORT(&req->length);
309 __GLX_SWAP_INT(&req->glxpixmap);
311 return __glXDisp_DestroyGLXPixmap(cl, pc);
314 int __glXDispSwap_QueryContext(__GLXclientState *cl, GLbyte *pc)
316 xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
317 __GLX_DECLARE_SWAP_VARIABLES;
319 __GLX_SWAP_INT(&req->context);
321 return __glXDisp_QueryContext(cl, pc);
324 int __glXDispSwap_CreatePbuffer(__GLXclientState *cl, GLbyte *pc)
326 xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
327 __GLX_DECLARE_SWAP_VARIABLES;
328 __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
331 __GLX_SWAP_INT(&req->screen);
332 __GLX_SWAP_INT(&req->fbconfig);
333 __GLX_SWAP_INT(&req->pbuffer);
334 __GLX_SWAP_INT(&req->numAttribs);
335 attribs = (CARD32*)(req + 1);
336 __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
338 return __glXDisp_CreatePbuffer(cl, pc);
341 int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
343 xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc;
344 __GLX_DECLARE_SWAP_VARIABLES;
346 __GLX_SWAP_INT(&req->screen);
347 __GLX_SWAP_INT(&req->fbconfig);
348 __GLX_SWAP_INT(&req->pbuffer);
349 __GLX_SWAP_INT(&req->width);
350 __GLX_SWAP_INT(&req->height);
352 return __glXDisp_CreateGLXPbufferSGIX(cl, pc);
355 int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
357 xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
358 __GLX_DECLARE_SWAP_VARIABLES;
360 __GLX_SWAP_INT(&req->pbuffer);
362 return __glXDisp_DestroyPbuffer(cl, pc);
365 int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
367 xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc;
368 __GLX_DECLARE_SWAP_VARIABLES;
370 __GLX_SWAP_INT(&req->pbuffer);
372 return __glXDisp_DestroyGLXPbufferSGIX(cl, pc);
375 int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
377 xGLXChangeDrawableAttributesReq *req =
378 (xGLXChangeDrawableAttributesReq *) pc;
379 __GLX_DECLARE_SWAP_VARIABLES;
380 __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
383 __GLX_SWAP_INT(&req->drawable);
384 __GLX_SWAP_INT(&req->numAttribs);
385 attribs = (CARD32*)(req + 1);
386 __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
388 return __glXDisp_ChangeDrawableAttributes(cl, pc);
391 int __glXDispSwap_ChangeDrawableAttributesSGIX(__GLXclientState *cl,
394 xGLXChangeDrawableAttributesSGIXReq *req =
395 (xGLXChangeDrawableAttributesSGIXReq *) pc;
396 __GLX_DECLARE_SWAP_VARIABLES;
397 __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
400 __GLX_SWAP_INT(&req->drawable);
401 __GLX_SWAP_INT(&req->numAttribs);
402 attribs = (CARD32*)(req + 1);
403 __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
405 return __glXDisp_ChangeDrawableAttributesSGIX(cl, pc);
408 int __glXDispSwap_CreateWindow(__GLXclientState *cl, GLbyte *pc)
410 xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
411 __GLX_DECLARE_SWAP_VARIABLES;
412 __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
415 __GLX_SWAP_INT(&req->screen);
416 __GLX_SWAP_INT(&req->fbconfig);
417 __GLX_SWAP_INT(&req->window);
418 __GLX_SWAP_INT(&req->glxwindow);
419 __GLX_SWAP_INT(&req->numAttribs);
420 attribs = (CARD32*)(req + 1);
421 __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
423 return __glXDisp_CreateWindow(cl, pc);
426 int __glXDispSwap_DestroyWindow(__GLXclientState *cl, GLbyte *pc)
428 xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
429 __GLX_DECLARE_SWAP_VARIABLES;
431 __GLX_SWAP_INT(&req->glxwindow);
433 return __glXDisp_DestroyWindow(cl, pc);
436 int __glXDispSwap_SwapBuffers(__GLXclientState *cl, GLbyte *pc)
438 xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
439 __GLX_DECLARE_SWAP_VARIABLES;
441 __GLX_SWAP_SHORT(&req->length);
442 __GLX_SWAP_INT(&req->contextTag);
443 __GLX_SWAP_INT(&req->drawable);
445 return __glXDisp_SwapBuffers(cl, pc);
448 int __glXDispSwap_UseXFont(__GLXclientState *cl, GLbyte *pc)
450 xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
451 __GLX_DECLARE_SWAP_VARIABLES;
453 __GLX_SWAP_SHORT(&req->length);
454 __GLX_SWAP_INT(&req->contextTag);
455 __GLX_SWAP_INT(&req->font);
456 __GLX_SWAP_INT(&req->first);
457 __GLX_SWAP_INT(&req->count);
458 __GLX_SWAP_INT(&req->listBase);
460 return __glXDisp_UseXFont(cl, pc);
464 int __glXDispSwap_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
466 xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *)pc;
467 __GLX_DECLARE_SWAP_VARIABLES;
469 __GLX_SWAP_SHORT(&req->length);
470 __GLX_SWAP_INT(&req->screen);
472 return __glXDisp_QueryExtensionsString(cl, pc);
475 int __glXDispSwap_QueryServerString(__GLXclientState *cl, GLbyte *pc)
477 xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc;
478 __GLX_DECLARE_SWAP_VARIABLES;
480 __GLX_SWAP_SHORT(&req->length);
481 __GLX_SWAP_INT(&req->screen);
482 __GLX_SWAP_INT(&req->name);
484 return __glXDisp_QueryServerString(cl, pc);
487 int __glXDispSwap_ClientInfo(__GLXclientState *cl, GLbyte *pc)
489 xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc;
490 __GLX_DECLARE_SWAP_VARIABLES;
492 __GLX_SWAP_SHORT(&req->length);
493 __GLX_SWAP_INT(&req->major);
494 __GLX_SWAP_INT(&req->minor);
495 __GLX_SWAP_INT(&req->numbytes);
497 return __glXDisp_ClientInfo(cl, pc);
500 int __glXDispSwap_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
502 xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
503 __GLX_DECLARE_SWAP_VARIABLES;
505 __GLX_SWAP_SHORT(&req->length);
506 __GLX_SWAP_INT(&req->context);
508 return __glXDisp_QueryContextInfoEXT(cl, pc);
511 int __glXDispSwap_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
513 xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
517 __GLX_DECLARE_SWAP_VARIABLES;
519 pc += __GLX_VENDPRIV_HDR_SIZE;
521 drawId = ((GLXDrawable *) (pc));
522 buffer = ((int *) (pc + 4));
524 __GLX_SWAP_SHORT(&req->length);
525 __GLX_SWAP_INT(&req->contextTag);
526 __GLX_SWAP_INT(drawId);
527 __GLX_SWAP_INT(buffer);
529 return __glXDisp_BindTexImageEXT(cl, (GLbyte *)pc);
532 int __glXDispSwap_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
534 xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
538 __GLX_DECLARE_SWAP_VARIABLES;
540 pc += __GLX_VENDPRIV_HDR_SIZE;
542 drawId = ((GLXDrawable *) (pc));
543 buffer = ((int *) (pc + 4));
545 __GLX_SWAP_SHORT(&req->length);
546 __GLX_SWAP_INT(&req->contextTag);
547 __GLX_SWAP_INT(drawId);
548 __GLX_SWAP_INT(buffer);
550 return __glXDisp_ReleaseTexImageEXT(cl, (GLbyte *)pc);
553 int __glXDispSwap_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
555 xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
559 __GLX_DECLARE_SWAP_VARIABLES;
564 pc += __GLX_VENDPRIV_HDR_SIZE;
566 __GLX_SWAP_SHORT(&req->length);
567 __GLX_SWAP_INT(&req->contextTag);
569 __GLX_SWAP_INT(pc + 4);
570 __GLX_SWAP_INT(pc + 8);
571 __GLX_SWAP_INT(pc + 12);
572 __GLX_SWAP_INT(pc + 16);
574 return __glXDisp_CopySubBufferMESA(cl, pc);
578 int __glXDispSwap_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
580 xGLXVendorPrivateWithReplyReq *req = (xGLXVendorPrivateWithReplyReq *)pc;
583 __GLX_DECLARE_SWAP_VARIABLES;
585 data = (CARD32 *) (req + 1);
586 __GLX_SWAP_SHORT(&req->length);
587 __GLX_SWAP_INT(&req->contextTag);
588 __GLX_SWAP_INT(data);
590 return __glXDisp_GetDrawableAttributesSGIX(cl, pc);
593 int __glXDispSwap_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
595 xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc;
597 __GLX_DECLARE_SWAP_VARIABLES;
599 __GLX_SWAP_SHORT(&req->length);
600 __GLX_SWAP_INT(&req->drawable);
602 return __glXDisp_GetDrawableAttributes(cl, pc);
606 /************************************************************************/
612 void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply *reply)
614 __GLX_DECLARE_SWAP_VARIABLES;
615 __GLX_SWAP_SHORT(&reply->sequenceNumber);
616 __GLX_SWAP_INT(&reply->length);
617 __GLX_SWAP_INT(&reply->contextTag);
618 WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)reply);
621 void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply)
623 __GLX_DECLARE_SWAP_VARIABLES;
624 __GLX_SWAP_SHORT(&reply->sequenceNumber);
625 __GLX_SWAP_INT(&reply->length);
626 WriteToClient(client, sz_xGLXIsDirectReply, (char *)reply);
629 void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply)
631 __GLX_DECLARE_SWAP_VARIABLES;
632 __GLX_SWAP_SHORT(&reply->sequenceNumber);
633 __GLX_SWAP_INT(&reply->length);
634 __GLX_SWAP_INT(&reply->majorVersion);
635 __GLX_SWAP_INT(&reply->minorVersion);
636 WriteToClient(client, sz_xGLXQueryVersionReply, (char *)reply);
639 void glxSwapQueryExtensionsStringReply(ClientPtr client,
640 xGLXQueryExtensionsStringReply *reply, char *buf)
642 int length = reply->length;
643 __GLX_DECLARE_SWAP_VARIABLES;
644 __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
645 __GLX_SWAP_SHORT(&reply->sequenceNumber);
646 __GLX_SWAP_INT(&reply->length);
647 __GLX_SWAP_INT(&reply->n);
648 WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *)reply);
649 __GLX_SWAP_INT_ARRAY((int *)buf, length);
650 WriteToClient(client, length << 2, buf);
653 void glxSwapQueryServerStringReply(ClientPtr client,
654 xGLXQueryServerStringReply *reply, char *buf)
656 int length = reply->length;
657 __GLX_DECLARE_SWAP_VARIABLES;
658 __GLX_SWAP_SHORT(&reply->sequenceNumber);
659 __GLX_SWAP_INT(&reply->length);
660 __GLX_SWAP_INT(&reply->n);
661 WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)reply);
662 /** no swap is needed for an array of chars **/
663 /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
664 WriteToClient(client, length << 2, buf);
667 void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply *reply, int *buf)
669 int length = reply->length;
670 __GLX_DECLARE_SWAP_VARIABLES;
671 __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
672 __GLX_SWAP_SHORT(&reply->sequenceNumber);
673 __GLX_SWAP_INT(&reply->length);
674 __GLX_SWAP_INT(&reply->n);
675 WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)reply);
676 __GLX_SWAP_INT_ARRAY((int *)buf, length);
677 WriteToClient(client, length << 2, (char *)buf);
680 void __glXSwapGetDrawableAttributesReply(ClientPtr client,
681 xGLXGetDrawableAttributesReply *reply, CARD32 *buf)
683 int length = reply->length;
684 __GLX_DECLARE_SWAP_VARIABLES;
685 __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
686 __GLX_SWAP_SHORT(&reply->sequenceNumber);
687 __GLX_SWAP_INT(&reply->length);
688 __GLX_SWAP_INT(&reply->numAttribs);
689 WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *)reply);
690 __GLX_SWAP_INT_ARRAY((int *)buf, length);
691 WriteToClient(client, length << 2, (char *)buf);
694 /************************************************************************/
697 ** Render and Renderlarge are not in the GLX API. They are used by the GLX
698 ** client library to send batches of GL rendering commands.
701 int __glXDispSwap_Render(__GLXclientState *cl, GLbyte *pc)
703 return __glXDisp_Render(cl, pc);
707 ** Execute a large rendering request (one that spans multiple X requests).
709 int __glXDispSwap_RenderLarge(__GLXclientState *cl, GLbyte *pc)
711 return __glXDisp_RenderLarge(cl, pc);
714 /************************************************************************/
717 ** No support is provided for the vendor-private requests other than
718 ** allocating these entry points in the dispatch table.
721 int __glXDispSwap_VendorPrivate(__GLXclientState *cl, GLbyte *pc)
723 xGLXVendorPrivateReq *req;
725 __GLXdispatchVendorPrivProcPtr proc;
727 __GLX_DECLARE_SWAP_VARIABLES;
729 req = (xGLXVendorPrivateReq *) pc;
730 __GLX_SWAP_SHORT(&req->length);
731 __GLX_SWAP_INT(&req->vendorCode);
733 vendorcode = req->vendorCode;
735 proc = (__GLXdispatchVendorPrivProcPtr)
736 __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info,
739 (*proc)(cl, (GLbyte*)req);
743 cl->client->errorValue = req->vendorCode;
744 return __glXError(GLXUnsupportedPrivateRequest);
748 int __glXDispSwap_VendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
750 xGLXVendorPrivateWithReplyReq *req;
752 __GLXdispatchVendorPrivProcPtr proc;
754 __GLX_DECLARE_SWAP_VARIABLES;
756 req = (xGLXVendorPrivateWithReplyReq *) pc;
757 __GLX_SWAP_SHORT(&req->length);
758 __GLX_SWAP_INT(&req->vendorCode);
760 vendorcode = req->vendorCode;
762 proc = (__GLXdispatchVendorPrivProcPtr)
763 __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info,
766 return (*proc)(cl, (GLbyte*)req);
769 cl->client->errorValue = req->vendorCode;
770 return __glXError(GLXUnsupportedPrivateRequest);