1/* DO NOT EDIT - This file generated automatically by glX_proto_recv.py (from Mesa) script */ 2 3/* 4 * (C) Copyright IBM Corporation 2005 5 * All Rights Reserved. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a 8 * copy of this software and associated documentation files (the "Software"), 9 * to deal in the Software without restriction, including without limitation 10 * the rights to use, copy, modify, merge, publish, distribute, sub license, 11 * and/or sell copies of the Software, and to permit persons to whom the 12 * Software is furnished to do so, subject to the following conditions: 13 * 14 * The above copyright notice and this permission notice (including the next 15 * paragraph) shall be included in all copies or substantial portions of the 16 * Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 21 * IBM, 22 * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 24 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 * SOFTWARE. 26 */ 27 28#include <inttypes.h> 29#include "glxserver.h" 30#include "indirect_size.h" 31#include "indirect_size_get.h" 32#include "indirect_dispatch.h" 33#include "glxbyteorder.h" 34#include "indirect_util.h" 35#include "singlesize.h" 36 37#define __GLX_PAD(x) (((x) + 3) & ~3) 38 39typedef struct { 40 __GLX_PIXEL_3D_HDR; 41} __GLXpixel3DHeader; 42 43extern GLboolean __glXErrorOccured(void); 44extern void __glXClearErrorOccured(void); 45 46static const unsigned dummy_answer[2] = { 0, 0 }; 47 48int 49__glXDisp_NewList(__GLXclientState * cl, GLbyte * pc) 50{ 51 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 52 int error; 53 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 54 55 pc += __GLX_SINGLE_HDR_SIZE; 56 if (cx != NULL) { 57 glNewList(*(GLuint *) (pc + 0), *(GLenum *) (pc + 4)); 58 error = Success; 59 } 60 61 return error; 62} 63 64int 65__glXDisp_EndList(__GLXclientState * cl, GLbyte * pc) 66{ 67 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 68 int error; 69 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 70 71 pc += __GLX_SINGLE_HDR_SIZE; 72 if (cx != NULL) { 73 glEndList(); 74 error = Success; 75 } 76 77 return error; 78} 79 80void 81__glXDisp_CallList(GLbyte * pc) 82{ 83 glCallList(*(GLuint *) (pc + 0)); 84} 85 86void 87__glXDisp_CallLists(GLbyte * pc) 88{ 89 const GLsizei n = *(GLsizei *) (pc + 0); 90 const GLenum type = *(GLenum *) (pc + 4); 91 const GLvoid *lists = (const GLvoid *) (pc + 8); 92 93 lists = (const GLvoid *) (pc + 8); 94 95 glCallLists(n, type, lists); 96} 97 98int 99__glXDisp_DeleteLists(__GLXclientState * cl, GLbyte * pc) 100{ 101 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 102 int error; 103 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 104 105 pc += __GLX_SINGLE_HDR_SIZE; 106 if (cx != NULL) { 107 glDeleteLists(*(GLuint *) (pc + 0), *(GLsizei *) (pc + 4)); 108 error = Success; 109 } 110 111 return error; 112} 113 114int 115__glXDisp_GenLists(__GLXclientState * cl, GLbyte * pc) 116{ 117 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 118 int error; 119 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 120 121 pc += __GLX_SINGLE_HDR_SIZE; 122 if (cx != NULL) { 123 GLuint retval; 124 125 retval = glGenLists(*(GLsizei *) (pc + 0)); 126 __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 127 error = Success; 128 } 129 130 return error; 131} 132 133void 134__glXDisp_ListBase(GLbyte * pc) 135{ 136 glListBase(*(GLuint *) (pc + 0)); 137} 138 139void 140__glXDisp_Begin(GLbyte * pc) 141{ 142 glBegin(*(GLenum *) (pc + 0)); 143} 144 145void 146__glXDisp_Bitmap(GLbyte * pc) 147{ 148 const GLubyte *const bitmap = (const GLubyte *) ((pc + 44)); 149 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 150 151 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 152 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 153 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 154 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 155 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 156 157 glBitmap(*(GLsizei *) (pc + 20), 158 *(GLsizei *) (pc + 24), 159 *(GLfloat *) (pc + 28), 160 *(GLfloat *) (pc + 32), 161 *(GLfloat *) (pc + 36), *(GLfloat *) (pc + 40), bitmap); 162} 163 164void 165__glXDisp_Color3bv(GLbyte * pc) 166{ 167 glColor3bv((const GLbyte *) (pc + 0)); 168} 169 170void 171__glXDisp_Color3dv(GLbyte * pc) 172{ 173#ifdef __GLX_ALIGN64 174 if ((unsigned long) (pc) & 7) { 175 (void) memmove(pc - 4, pc, 24); 176 pc -= 4; 177 } 178#endif 179 180 glColor3dv((const GLdouble *) (pc + 0)); 181} 182 183void 184__glXDisp_Color3fv(GLbyte * pc) 185{ 186 glColor3fv((const GLfloat *) (pc + 0)); 187} 188 189void 190__glXDisp_Color3iv(GLbyte * pc) 191{ 192 glColor3iv((const GLint *) (pc + 0)); 193} 194 195void 196__glXDisp_Color3sv(GLbyte * pc) 197{ 198 glColor3sv((const GLshort *) (pc + 0)); 199} 200 201void 202__glXDisp_Color3ubv(GLbyte * pc) 203{ 204 glColor3ubv((const GLubyte *) (pc + 0)); 205} 206 207void 208__glXDisp_Color3uiv(GLbyte * pc) 209{ 210 glColor3uiv((const GLuint *) (pc + 0)); 211} 212 213void 214__glXDisp_Color3usv(GLbyte * pc) 215{ 216 glColor3usv((const GLushort *) (pc + 0)); 217} 218 219void 220__glXDisp_Color4bv(GLbyte * pc) 221{ 222 glColor4bv((const GLbyte *) (pc + 0)); 223} 224 225void 226__glXDisp_Color4dv(GLbyte * pc) 227{ 228#ifdef __GLX_ALIGN64 229 if ((unsigned long) (pc) & 7) { 230 (void) memmove(pc - 4, pc, 32); 231 pc -= 4; 232 } 233#endif 234 235 glColor4dv((const GLdouble *) (pc + 0)); 236} 237 238void 239__glXDisp_Color4fv(GLbyte * pc) 240{ 241 glColor4fv((const GLfloat *) (pc + 0)); 242} 243 244void 245__glXDisp_Color4iv(GLbyte * pc) 246{ 247 glColor4iv((const GLint *) (pc + 0)); 248} 249 250void 251__glXDisp_Color4sv(GLbyte * pc) 252{ 253 glColor4sv((const GLshort *) (pc + 0)); 254} 255 256void 257__glXDisp_Color4ubv(GLbyte * pc) 258{ 259 glColor4ubv((const GLubyte *) (pc + 0)); 260} 261 262void 263__glXDisp_Color4uiv(GLbyte * pc) 264{ 265 glColor4uiv((const GLuint *) (pc + 0)); 266} 267 268void 269__glXDisp_Color4usv(GLbyte * pc) 270{ 271 glColor4usv((const GLushort *) (pc + 0)); 272} 273 274void 275__glXDisp_EdgeFlagv(GLbyte * pc) 276{ 277 glEdgeFlagv((const GLboolean *) (pc + 0)); 278} 279 280void 281__glXDisp_End(GLbyte * pc) 282{ 283 glEnd(); 284} 285 286void 287__glXDisp_Indexdv(GLbyte * pc) 288{ 289#ifdef __GLX_ALIGN64 290 if ((unsigned long) (pc) & 7) { 291 (void) memmove(pc - 4, pc, 8); 292 pc -= 4; 293 } 294#endif 295 296 glIndexdv((const GLdouble *) (pc + 0)); 297} 298 299void 300__glXDisp_Indexfv(GLbyte * pc) 301{ 302 glIndexfv((const GLfloat *) (pc + 0)); 303} 304 305void 306__glXDisp_Indexiv(GLbyte * pc) 307{ 308 glIndexiv((const GLint *) (pc + 0)); 309} 310 311void 312__glXDisp_Indexsv(GLbyte * pc) 313{ 314 glIndexsv((const GLshort *) (pc + 0)); 315} 316 317void 318__glXDisp_Normal3bv(GLbyte * pc) 319{ 320 glNormal3bv((const GLbyte *) (pc + 0)); 321} 322 323void 324__glXDisp_Normal3dv(GLbyte * pc) 325{ 326#ifdef __GLX_ALIGN64 327 if ((unsigned long) (pc) & 7) { 328 (void) memmove(pc - 4, pc, 24); 329 pc -= 4; 330 } 331#endif 332 333 glNormal3dv((const GLdouble *) (pc + 0)); 334} 335 336void 337__glXDisp_Normal3fv(GLbyte * pc) 338{ 339 glNormal3fv((const GLfloat *) (pc + 0)); 340} 341 342void 343__glXDisp_Normal3iv(GLbyte * pc) 344{ 345 glNormal3iv((const GLint *) (pc + 0)); 346} 347 348void 349__glXDisp_Normal3sv(GLbyte * pc) 350{ 351 glNormal3sv((const GLshort *) (pc + 0)); 352} 353 354void 355__glXDisp_RasterPos2dv(GLbyte * pc) 356{ 357#ifdef __GLX_ALIGN64 358 if ((unsigned long) (pc) & 7) { 359 (void) memmove(pc - 4, pc, 16); 360 pc -= 4; 361 } 362#endif 363 364 glRasterPos2dv((const GLdouble *) (pc + 0)); 365} 366 367void 368__glXDisp_RasterPos2fv(GLbyte * pc) 369{ 370 glRasterPos2fv((const GLfloat *) (pc + 0)); 371} 372 373void 374__glXDisp_RasterPos2iv(GLbyte * pc) 375{ 376 glRasterPos2iv((const GLint *) (pc + 0)); 377} 378 379void 380__glXDisp_RasterPos2sv(GLbyte * pc) 381{ 382 glRasterPos2sv((const GLshort *) (pc + 0)); 383} 384 385void 386__glXDisp_RasterPos3dv(GLbyte * pc) 387{ 388#ifdef __GLX_ALIGN64 389 if ((unsigned long) (pc) & 7) { 390 (void) memmove(pc - 4, pc, 24); 391 pc -= 4; 392 } 393#endif 394 395 glRasterPos3dv((const GLdouble *) (pc + 0)); 396} 397 398void 399__glXDisp_RasterPos3fv(GLbyte * pc) 400{ 401 glRasterPos3fv((const GLfloat *) (pc + 0)); 402} 403 404void 405__glXDisp_RasterPos3iv(GLbyte * pc) 406{ 407 glRasterPos3iv((const GLint *) (pc + 0)); 408} 409 410void 411__glXDisp_RasterPos3sv(GLbyte * pc) 412{ 413 glRasterPos3sv((const GLshort *) (pc + 0)); 414} 415 416void 417__glXDisp_RasterPos4dv(GLbyte * pc) 418{ 419#ifdef __GLX_ALIGN64 420 if ((unsigned long) (pc) & 7) { 421 (void) memmove(pc - 4, pc, 32); 422 pc -= 4; 423 } 424#endif 425 426 glRasterPos4dv((const GLdouble *) (pc + 0)); 427} 428 429void 430__glXDisp_RasterPos4fv(GLbyte * pc) 431{ 432 glRasterPos4fv((const GLfloat *) (pc + 0)); 433} 434 435void 436__glXDisp_RasterPos4iv(GLbyte * pc) 437{ 438 glRasterPos4iv((const GLint *) (pc + 0)); 439} 440 441void 442__glXDisp_RasterPos4sv(GLbyte * pc) 443{ 444 glRasterPos4sv((const GLshort *) (pc + 0)); 445} 446 447void 448__glXDisp_Rectdv(GLbyte * pc) 449{ 450#ifdef __GLX_ALIGN64 451 if ((unsigned long) (pc) & 7) { 452 (void) memmove(pc - 4, pc, 32); 453 pc -= 4; 454 } 455#endif 456 457 glRectdv((const GLdouble *) (pc + 0), (const GLdouble *) (pc + 16)); 458} 459 460void 461__glXDisp_Rectfv(GLbyte * pc) 462{ 463 glRectfv((const GLfloat *) (pc + 0), (const GLfloat *) (pc + 8)); 464} 465 466void 467__glXDisp_Rectiv(GLbyte * pc) 468{ 469 glRectiv((const GLint *) (pc + 0), (const GLint *) (pc + 8)); 470} 471 472void 473__glXDisp_Rectsv(GLbyte * pc) 474{ 475 glRectsv((const GLshort *) (pc + 0), (const GLshort *) (pc + 4)); 476} 477 478void 479__glXDisp_TexCoord1dv(GLbyte * pc) 480{ 481#ifdef __GLX_ALIGN64 482 if ((unsigned long) (pc) & 7) { 483 (void) memmove(pc - 4, pc, 8); 484 pc -= 4; 485 } 486#endif 487 488 glTexCoord1dv((const GLdouble *) (pc + 0)); 489} 490 491void 492__glXDisp_TexCoord1fv(GLbyte * pc) 493{ 494 glTexCoord1fv((const GLfloat *) (pc + 0)); 495} 496 497void 498__glXDisp_TexCoord1iv(GLbyte * pc) 499{ 500 glTexCoord1iv((const GLint *) (pc + 0)); 501} 502 503void 504__glXDisp_TexCoord1sv(GLbyte * pc) 505{ 506 glTexCoord1sv((const GLshort *) (pc + 0)); 507} 508 509void 510__glXDisp_TexCoord2dv(GLbyte * pc) 511{ 512#ifdef __GLX_ALIGN64 513 if ((unsigned long) (pc) & 7) { 514 (void) memmove(pc - 4, pc, 16); 515 pc -= 4; 516 } 517#endif 518 519 glTexCoord2dv((const GLdouble *) (pc + 0)); 520} 521 522void 523__glXDisp_TexCoord2fv(GLbyte * pc) 524{ 525 glTexCoord2fv((const GLfloat *) (pc + 0)); 526} 527 528void 529__glXDisp_TexCoord2iv(GLbyte * pc) 530{ 531 glTexCoord2iv((const GLint *) (pc + 0)); 532} 533 534void 535__glXDisp_TexCoord2sv(GLbyte * pc) 536{ 537 glTexCoord2sv((const GLshort *) (pc + 0)); 538} 539 540void 541__glXDisp_TexCoord3dv(GLbyte * pc) 542{ 543#ifdef __GLX_ALIGN64 544 if ((unsigned long) (pc) & 7) { 545 (void) memmove(pc - 4, pc, 24); 546 pc -= 4; 547 } 548#endif 549 550 glTexCoord3dv((const GLdouble *) (pc + 0)); 551} 552 553void 554__glXDisp_TexCoord3fv(GLbyte * pc) 555{ 556 glTexCoord3fv((const GLfloat *) (pc + 0)); 557} 558 559void 560__glXDisp_TexCoord3iv(GLbyte * pc) 561{ 562 glTexCoord3iv((const GLint *) (pc + 0)); 563} 564 565void 566__glXDisp_TexCoord3sv(GLbyte * pc) 567{ 568 glTexCoord3sv((const GLshort *) (pc + 0)); 569} 570 571void 572__glXDisp_TexCoord4dv(GLbyte * pc) 573{ 574#ifdef __GLX_ALIGN64 575 if ((unsigned long) (pc) & 7) { 576 (void) memmove(pc - 4, pc, 32); 577 pc -= 4; 578 } 579#endif 580 581 glTexCoord4dv((const GLdouble *) (pc + 0)); 582} 583 584void 585__glXDisp_TexCoord4fv(GLbyte * pc) 586{ 587 glTexCoord4fv((const GLfloat *) (pc + 0)); 588} 589 590void 591__glXDisp_TexCoord4iv(GLbyte * pc) 592{ 593 glTexCoord4iv((const GLint *) (pc + 0)); 594} 595 596void 597__glXDisp_TexCoord4sv(GLbyte * pc) 598{ 599 glTexCoord4sv((const GLshort *) (pc + 0)); 600} 601 602void 603__glXDisp_Vertex2dv(GLbyte * pc) 604{ 605#ifdef __GLX_ALIGN64 606 if ((unsigned long) (pc) & 7) { 607 (void) memmove(pc - 4, pc, 16); 608 pc -= 4; 609 } 610#endif 611 612 glVertex2dv((const GLdouble *) (pc + 0)); 613} 614 615void 616__glXDisp_Vertex2fv(GLbyte * pc) 617{ 618 glVertex2fv((const GLfloat *) (pc + 0)); 619} 620 621void 622__glXDisp_Vertex2iv(GLbyte * pc) 623{ 624 glVertex2iv((const GLint *) (pc + 0)); 625} 626 627void 628__glXDisp_Vertex2sv(GLbyte * pc) 629{ 630 glVertex2sv((const GLshort *) (pc + 0)); 631} 632 633void 634__glXDisp_Vertex3dv(GLbyte * pc) 635{ 636#ifdef __GLX_ALIGN64 637 if ((unsigned long) (pc) & 7) { 638 (void) memmove(pc - 4, pc, 24); 639 pc -= 4; 640 } 641#endif 642 643 glVertex3dv((const GLdouble *) (pc + 0)); 644} 645 646void 647__glXDisp_Vertex3fv(GLbyte * pc) 648{ 649 glVertex3fv((const GLfloat *) (pc + 0)); 650} 651 652void 653__glXDisp_Vertex3iv(GLbyte * pc) 654{ 655 glVertex3iv((const GLint *) (pc + 0)); 656} 657 658void 659__glXDisp_Vertex3sv(GLbyte * pc) 660{ 661 glVertex3sv((const GLshort *) (pc + 0)); 662} 663 664void 665__glXDisp_Vertex4dv(GLbyte * pc) 666{ 667#ifdef __GLX_ALIGN64 668 if ((unsigned long) (pc) & 7) { 669 (void) memmove(pc - 4, pc, 32); 670 pc -= 4; 671 } 672#endif 673 674 glVertex4dv((const GLdouble *) (pc + 0)); 675} 676 677void 678__glXDisp_Vertex4fv(GLbyte * pc) 679{ 680 glVertex4fv((const GLfloat *) (pc + 0)); 681} 682 683void 684__glXDisp_Vertex4iv(GLbyte * pc) 685{ 686 glVertex4iv((const GLint *) (pc + 0)); 687} 688 689void 690__glXDisp_Vertex4sv(GLbyte * pc) 691{ 692 glVertex4sv((const GLshort *) (pc + 0)); 693} 694 695void 696__glXDisp_ClipPlane(GLbyte * pc) 697{ 698#ifdef __GLX_ALIGN64 699 if ((unsigned long) (pc) & 7) { 700 (void) memmove(pc - 4, pc, 36); 701 pc -= 4; 702 } 703#endif 704 705 glClipPlane(*(GLenum *) (pc + 32), (const GLdouble *) (pc + 0)); 706} 707 708void 709__glXDisp_ColorMaterial(GLbyte * pc) 710{ 711 glColorMaterial(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); 712} 713 714void 715__glXDisp_CullFace(GLbyte * pc) 716{ 717 glCullFace(*(GLenum *) (pc + 0)); 718} 719 720void 721__glXDisp_Fogf(GLbyte * pc) 722{ 723 glFogf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); 724} 725 726void 727__glXDisp_Fogfv(GLbyte * pc) 728{ 729 const GLenum pname = *(GLenum *) (pc + 0); 730 const GLfloat *params; 731 732 params = (const GLfloat *) (pc + 4); 733 734 glFogfv(pname, params); 735} 736 737void 738__glXDisp_Fogi(GLbyte * pc) 739{ 740 glFogi(*(GLenum *) (pc + 0), *(GLint *) (pc + 4)); 741} 742 743void 744__glXDisp_Fogiv(GLbyte * pc) 745{ 746 const GLenum pname = *(GLenum *) (pc + 0); 747 const GLint *params; 748 749 params = (const GLint *) (pc + 4); 750 751 glFogiv(pname, params); 752} 753 754void 755__glXDisp_FrontFace(GLbyte * pc) 756{ 757 glFrontFace(*(GLenum *) (pc + 0)); 758} 759 760void 761__glXDisp_Hint(GLbyte * pc) 762{ 763 glHint(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); 764} 765 766void 767__glXDisp_Lightf(GLbyte * pc) 768{ 769 glLightf(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8)); 770} 771 772void 773__glXDisp_Lightfv(GLbyte * pc) 774{ 775 const GLenum pname = *(GLenum *) (pc + 4); 776 const GLfloat *params; 777 778 params = (const GLfloat *) (pc + 8); 779 780 glLightfv(*(GLenum *) (pc + 0), pname, params); 781} 782 783void 784__glXDisp_Lighti(GLbyte * pc) 785{ 786 glLighti(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8)); 787} 788 789void 790__glXDisp_Lightiv(GLbyte * pc) 791{ 792 const GLenum pname = *(GLenum *) (pc + 4); 793 const GLint *params; 794 795 params = (const GLint *) (pc + 8); 796 797 glLightiv(*(GLenum *) (pc + 0), pname, params); 798} 799 800void 801__glXDisp_LightModelf(GLbyte * pc) 802{ 803 glLightModelf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); 804} 805 806void 807__glXDisp_LightModelfv(GLbyte * pc) 808{ 809 const GLenum pname = *(GLenum *) (pc + 0); 810 const GLfloat *params; 811 812 params = (const GLfloat *) (pc + 4); 813 814 glLightModelfv(pname, params); 815} 816 817void 818__glXDisp_LightModeli(GLbyte * pc) 819{ 820 glLightModeli(*(GLenum *) (pc + 0), *(GLint *) (pc + 4)); 821} 822 823void 824__glXDisp_LightModeliv(GLbyte * pc) 825{ 826 const GLenum pname = *(GLenum *) (pc + 0); 827 const GLint *params; 828 829 params = (const GLint *) (pc + 4); 830 831 glLightModeliv(pname, params); 832} 833 834void 835__glXDisp_LineStipple(GLbyte * pc) 836{ 837 glLineStipple(*(GLint *) (pc + 0), *(GLushort *) (pc + 4)); 838} 839 840void 841__glXDisp_LineWidth(GLbyte * pc) 842{ 843 glLineWidth(*(GLfloat *) (pc + 0)); 844} 845 846void 847__glXDisp_Materialf(GLbyte * pc) 848{ 849 glMaterialf(*(GLenum *) (pc + 0), 850 *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8)); 851} 852 853void 854__glXDisp_Materialfv(GLbyte * pc) 855{ 856 const GLenum pname = *(GLenum *) (pc + 4); 857 const GLfloat *params; 858 859 params = (const GLfloat *) (pc + 8); 860 861 glMaterialfv(*(GLenum *) (pc + 0), pname, params); 862} 863 864void 865__glXDisp_Materiali(GLbyte * pc) 866{ 867 glMateriali(*(GLenum *) (pc + 0), 868 *(GLenum *) (pc + 4), *(GLint *) (pc + 8)); 869} 870 871void 872__glXDisp_Materialiv(GLbyte * pc) 873{ 874 const GLenum pname = *(GLenum *) (pc + 4); 875 const GLint *params; 876 877 params = (const GLint *) (pc + 8); 878 879 glMaterialiv(*(GLenum *) (pc + 0), pname, params); 880} 881 882void 883__glXDisp_PointSize(GLbyte * pc) 884{ 885 glPointSize(*(GLfloat *) (pc + 0)); 886} 887 888void 889__glXDisp_PolygonMode(GLbyte * pc) 890{ 891 glPolygonMode(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); 892} 893 894void 895__glXDisp_PolygonStipple(GLbyte * pc) 896{ 897 const GLubyte *const mask = (const GLubyte *) ((pc + 20)); 898 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 899 900 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 901 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 902 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 903 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 904 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 905 906 glPolygonStipple(mask); 907} 908 909void 910__glXDisp_Scissor(GLbyte * pc) 911{ 912 glScissor(*(GLint *) (pc + 0), 913 *(GLint *) (pc + 4), 914 *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12)); 915} 916 917void 918__glXDisp_ShadeModel(GLbyte * pc) 919{ 920 glShadeModel(*(GLenum *) (pc + 0)); 921} 922 923void 924__glXDisp_TexParameterf(GLbyte * pc) 925{ 926 glTexParameterf(*(GLenum *) (pc + 0), 927 *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8)); 928} 929 930void 931__glXDisp_TexParameterfv(GLbyte * pc) 932{ 933 const GLenum pname = *(GLenum *) (pc + 4); 934 const GLfloat *params; 935 936 params = (const GLfloat *) (pc + 8); 937 938 glTexParameterfv(*(GLenum *) (pc + 0), pname, params); 939} 940 941void 942__glXDisp_TexParameteri(GLbyte * pc) 943{ 944 glTexParameteri(*(GLenum *) (pc + 0), 945 *(GLenum *) (pc + 4), *(GLint *) (pc + 8)); 946} 947 948void 949__glXDisp_TexParameteriv(GLbyte * pc) 950{ 951 const GLenum pname = *(GLenum *) (pc + 4); 952 const GLint *params; 953 954 params = (const GLint *) (pc + 8); 955 956 glTexParameteriv(*(GLenum *) (pc + 0), pname, params); 957} 958 959void 960__glXDisp_TexImage1D(GLbyte * pc) 961{ 962 const GLvoid *const pixels = (const GLvoid *) ((pc + 52)); 963 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 964 965 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 966 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 967 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 968 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 969 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 970 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 971 972 glTexImage1D(*(GLenum *) (pc + 20), 973 *(GLint *) (pc + 24), 974 *(GLint *) (pc + 28), 975 *(GLsizei *) (pc + 32), 976 *(GLint *) (pc + 40), 977 *(GLenum *) (pc + 44), *(GLenum *) (pc + 48), pixels); 978} 979 980void 981__glXDisp_TexImage2D(GLbyte * pc) 982{ 983 const GLvoid *const pixels = (const GLvoid *) ((pc + 52)); 984 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 985 986 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 987 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 988 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 989 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 990 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 991 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 992 993 glTexImage2D(*(GLenum *) (pc + 20), 994 *(GLint *) (pc + 24), 995 *(GLint *) (pc + 28), 996 *(GLsizei *) (pc + 32), 997 *(GLsizei *) (pc + 36), 998 *(GLint *) (pc + 40), 999 *(GLenum *) (pc + 44), *(GLenum *) (pc + 48), pixels); 1000} 1001 1002void 1003__glXDisp_TexEnvf(GLbyte * pc) 1004{ 1005 glTexEnvf(*(GLenum *) (pc + 0), 1006 *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8)); 1007} 1008 1009void 1010__glXDisp_TexEnvfv(GLbyte * pc) 1011{ 1012 const GLenum pname = *(GLenum *) (pc + 4); 1013 const GLfloat *params; 1014 1015 params = (const GLfloat *) (pc + 8); 1016 1017 glTexEnvfv(*(GLenum *) (pc + 0), pname, params); 1018} 1019 1020void 1021__glXDisp_TexEnvi(GLbyte * pc) 1022{ 1023 glTexEnvi(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8)); 1024} 1025 1026void 1027__glXDisp_TexEnviv(GLbyte * pc) 1028{ 1029 const GLenum pname = *(GLenum *) (pc + 4); 1030 const GLint *params; 1031 1032 params = (const GLint *) (pc + 8); 1033 1034 glTexEnviv(*(GLenum *) (pc + 0), pname, params); 1035} 1036 1037void 1038__glXDisp_TexGend(GLbyte * pc) 1039{ 1040#ifdef __GLX_ALIGN64 1041 if ((unsigned long) (pc) & 7) { 1042 (void) memmove(pc - 4, pc, 16); 1043 pc -= 4; 1044 } 1045#endif 1046 1047 glTexGend(*(GLenum *) (pc + 8), 1048 *(GLenum *) (pc + 12), *(GLdouble *) (pc + 0)); 1049} 1050 1051void 1052__glXDisp_TexGendv(GLbyte * pc) 1053{ 1054 const GLenum pname = *(GLenum *) (pc + 4); 1055 const GLdouble *params; 1056 1057#ifdef __GLX_ALIGN64 1058 const GLuint compsize = __glTexGendv_size(pname); 1059 const GLuint cmdlen = 12 + __GLX_PAD((compsize * 8)) - 4; 1060 1061 if ((unsigned long) (pc) & 7) { 1062 (void) memmove(pc - 4, pc, cmdlen); 1063 pc -= 4; 1064 } 1065#endif 1066 1067 params = (const GLdouble *) (pc + 8); 1068 1069 glTexGendv(*(GLenum *) (pc + 0), pname, params); 1070} 1071 1072void 1073__glXDisp_TexGenf(GLbyte * pc) 1074{ 1075 glTexGenf(*(GLenum *) (pc + 0), 1076 *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8)); 1077} 1078 1079void 1080__glXDisp_TexGenfv(GLbyte * pc) 1081{ 1082 const GLenum pname = *(GLenum *) (pc + 4); 1083 const GLfloat *params; 1084 1085 params = (const GLfloat *) (pc + 8); 1086 1087 glTexGenfv(*(GLenum *) (pc + 0), pname, params); 1088} 1089 1090void 1091__glXDisp_TexGeni(GLbyte * pc) 1092{ 1093 glTexGeni(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8)); 1094} 1095 1096void 1097__glXDisp_TexGeniv(GLbyte * pc) 1098{ 1099 const GLenum pname = *(GLenum *) (pc + 4); 1100 const GLint *params; 1101 1102 params = (const GLint *) (pc + 8); 1103 1104 glTexGeniv(*(GLenum *) (pc + 0), pname, params); 1105} 1106 1107void 1108__glXDisp_InitNames(GLbyte * pc) 1109{ 1110 glInitNames(); 1111} 1112 1113void 1114__glXDisp_LoadName(GLbyte * pc) 1115{ 1116 glLoadName(*(GLuint *) (pc + 0)); 1117} 1118 1119void 1120__glXDisp_PassThrough(GLbyte * pc) 1121{ 1122 glPassThrough(*(GLfloat *) (pc + 0)); 1123} 1124 1125void 1126__glXDisp_PopName(GLbyte * pc) 1127{ 1128 glPopName(); 1129} 1130 1131void 1132__glXDisp_PushName(GLbyte * pc) 1133{ 1134 glPushName(*(GLuint *) (pc + 0)); 1135} 1136 1137void 1138__glXDisp_DrawBuffer(GLbyte * pc) 1139{ 1140 glDrawBuffer(*(GLenum *) (pc + 0)); 1141} 1142 1143void 1144__glXDisp_Clear(GLbyte * pc) 1145{ 1146 glClear(*(GLbitfield *) (pc + 0)); 1147} 1148 1149void 1150__glXDisp_ClearAccum(GLbyte * pc) 1151{ 1152 glClearAccum(*(GLfloat *) (pc + 0), 1153 *(GLfloat *) (pc + 4), 1154 *(GLfloat *) (pc + 8), *(GLfloat *) (pc + 12)); 1155} 1156 1157void 1158__glXDisp_ClearIndex(GLbyte * pc) 1159{ 1160 glClearIndex(*(GLfloat *) (pc + 0)); 1161} 1162 1163void 1164__glXDisp_ClearColor(GLbyte * pc) 1165{ 1166 glClearColor(*(GLclampf *) (pc + 0), 1167 *(GLclampf *) (pc + 4), 1168 *(GLclampf *) (pc + 8), *(GLclampf *) (pc + 12)); 1169} 1170 1171void 1172__glXDisp_ClearStencil(GLbyte * pc) 1173{ 1174 glClearStencil(*(GLint *) (pc + 0)); 1175} 1176 1177void 1178__glXDisp_ClearDepth(GLbyte * pc) 1179{ 1180#ifdef __GLX_ALIGN64 1181 if ((unsigned long) (pc) & 7) { 1182 (void) memmove(pc - 4, pc, 8); 1183 pc -= 4; 1184 } 1185#endif 1186 1187 glClearDepth(*(GLclampd *) (pc + 0)); 1188} 1189 1190void 1191__glXDisp_StencilMask(GLbyte * pc) 1192{ 1193 glStencilMask(*(GLuint *) (pc + 0)); 1194} 1195 1196void 1197__glXDisp_ColorMask(GLbyte * pc) 1198{ 1199 glColorMask(*(GLboolean *) (pc + 0), 1200 *(GLboolean *) (pc + 1), 1201 *(GLboolean *) (pc + 2), *(GLboolean *) (pc + 3)); 1202} 1203 1204void 1205__glXDisp_DepthMask(GLbyte * pc) 1206{ 1207 glDepthMask(*(GLboolean *) (pc + 0)); 1208} 1209 1210void 1211__glXDisp_IndexMask(GLbyte * pc) 1212{ 1213 glIndexMask(*(GLuint *) (pc + 0)); 1214} 1215 1216void 1217__glXDisp_Accum(GLbyte * pc) 1218{ 1219 glAccum(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); 1220} 1221 1222void 1223__glXDisp_Disable(GLbyte * pc) 1224{ 1225 glDisable(*(GLenum *) (pc + 0)); 1226} 1227 1228void 1229__glXDisp_Enable(GLbyte * pc) 1230{ 1231 glEnable(*(GLenum *) (pc + 0)); 1232} 1233 1234void 1235__glXDisp_PopAttrib(GLbyte * pc) 1236{ 1237 glPopAttrib(); 1238} 1239 1240void 1241__glXDisp_PushAttrib(GLbyte * pc) 1242{ 1243 glPushAttrib(*(GLbitfield *) (pc + 0)); 1244} 1245 1246void 1247__glXDisp_MapGrid1d(GLbyte * pc) 1248{ 1249#ifdef __GLX_ALIGN64 1250 if ((unsigned long) (pc) & 7) { 1251 (void) memmove(pc - 4, pc, 20); 1252 pc -= 4; 1253 } 1254#endif 1255 1256 glMapGrid1d(*(GLint *) (pc + 16), 1257 *(GLdouble *) (pc + 0), *(GLdouble *) (pc + 8)); 1258} 1259 1260void 1261__glXDisp_MapGrid1f(GLbyte * pc) 1262{ 1263 glMapGrid1f(*(GLint *) (pc + 0), 1264 *(GLfloat *) (pc + 4), *(GLfloat *) (pc + 8)); 1265} 1266 1267void 1268__glXDisp_MapGrid2d(GLbyte * pc) 1269{ 1270#ifdef __GLX_ALIGN64 1271 if ((unsigned long) (pc) & 7) { 1272 (void) memmove(pc - 4, pc, 40); 1273 pc -= 4; 1274 } 1275#endif 1276 1277 glMapGrid2d(*(GLint *) (pc + 32), 1278 *(GLdouble *) (pc + 0), 1279 *(GLdouble *) (pc + 8), 1280 *(GLint *) (pc + 36), 1281 *(GLdouble *) (pc + 16), *(GLdouble *) (pc + 24)); 1282} 1283 1284void 1285__glXDisp_MapGrid2f(GLbyte * pc) 1286{ 1287 glMapGrid2f(*(GLint *) (pc + 0), 1288 *(GLfloat *) (pc + 4), 1289 *(GLfloat *) (pc + 8), 1290 *(GLint *) (pc + 12), 1291 *(GLfloat *) (pc + 16), *(GLfloat *) (pc + 20)); 1292} 1293 1294void 1295__glXDisp_EvalCoord1dv(GLbyte * pc) 1296{ 1297#ifdef __GLX_ALIGN64 1298 if ((unsigned long) (pc) & 7) { 1299 (void) memmove(pc - 4, pc, 8); 1300 pc -= 4; 1301 } 1302#endif 1303 1304 glEvalCoord1dv((const GLdouble *) (pc + 0)); 1305} 1306 1307void 1308__glXDisp_EvalCoord1fv(GLbyte * pc) 1309{ 1310 glEvalCoord1fv((const GLfloat *) (pc + 0)); 1311} 1312 1313void 1314__glXDisp_EvalCoord2dv(GLbyte * pc) 1315{ 1316#ifdef __GLX_ALIGN64 1317 if ((unsigned long) (pc) & 7) { 1318 (void) memmove(pc - 4, pc, 16); 1319 pc -= 4; 1320 } 1321#endif 1322 1323 glEvalCoord2dv((const GLdouble *) (pc + 0)); 1324} 1325 1326void 1327__glXDisp_EvalCoord2fv(GLbyte * pc) 1328{ 1329 glEvalCoord2fv((const GLfloat *) (pc + 0)); 1330} 1331 1332void 1333__glXDisp_EvalMesh1(GLbyte * pc) 1334{ 1335 glEvalMesh1(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLint *) (pc + 8)); 1336} 1337 1338void 1339__glXDisp_EvalPoint1(GLbyte * pc) 1340{ 1341 glEvalPoint1(*(GLint *) (pc + 0)); 1342} 1343 1344void 1345__glXDisp_EvalMesh2(GLbyte * pc) 1346{ 1347 glEvalMesh2(*(GLenum *) (pc + 0), 1348 *(GLint *) (pc + 4), 1349 *(GLint *) (pc + 8), 1350 *(GLint *) (pc + 12), *(GLint *) (pc + 16)); 1351} 1352 1353void 1354__glXDisp_EvalPoint2(GLbyte * pc) 1355{ 1356 glEvalPoint2(*(GLint *) (pc + 0), *(GLint *) (pc + 4)); 1357} 1358 1359void 1360__glXDisp_AlphaFunc(GLbyte * pc) 1361{ 1362 glAlphaFunc(*(GLenum *) (pc + 0), *(GLclampf *) (pc + 4)); 1363} 1364 1365void 1366__glXDisp_BlendFunc(GLbyte * pc) 1367{ 1368 glBlendFunc(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); 1369} 1370 1371void 1372__glXDisp_LogicOp(GLbyte * pc) 1373{ 1374 glLogicOp(*(GLenum *) (pc + 0)); 1375} 1376 1377void 1378__glXDisp_StencilFunc(GLbyte * pc) 1379{ 1380 glStencilFunc(*(GLenum *) (pc + 0), 1381 *(GLint *) (pc + 4), *(GLuint *) (pc + 8)); 1382} 1383 1384void 1385__glXDisp_StencilOp(GLbyte * pc) 1386{ 1387 glStencilOp(*(GLenum *) (pc + 0), 1388 *(GLenum *) (pc + 4), *(GLenum *) (pc + 8)); 1389} 1390 1391void 1392__glXDisp_DepthFunc(GLbyte * pc) 1393{ 1394 glDepthFunc(*(GLenum *) (pc + 0)); 1395} 1396 1397void 1398__glXDisp_PixelZoom(GLbyte * pc) 1399{ 1400 glPixelZoom(*(GLfloat *) (pc + 0), *(GLfloat *) (pc + 4)); 1401} 1402 1403void 1404__glXDisp_PixelTransferf(GLbyte * pc) 1405{ 1406 glPixelTransferf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); 1407} 1408 1409void 1410__glXDisp_PixelTransferi(GLbyte * pc) 1411{ 1412 glPixelTransferi(*(GLenum *) (pc + 0), *(GLint *) (pc + 4)); 1413} 1414 1415int 1416__glXDisp_PixelStoref(__GLXclientState * cl, GLbyte * pc) 1417{ 1418 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1419 int error; 1420 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1421 1422 pc += __GLX_SINGLE_HDR_SIZE; 1423 if (cx != NULL) { 1424 glPixelStoref(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); 1425 error = Success; 1426 } 1427 1428 return error; 1429} 1430 1431int 1432__glXDisp_PixelStorei(__GLXclientState * cl, GLbyte * pc) 1433{ 1434 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1435 int error; 1436 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1437 1438 pc += __GLX_SINGLE_HDR_SIZE; 1439 if (cx != NULL) { 1440 glPixelStorei(*(GLenum *) (pc + 0), *(GLint *) (pc + 4)); 1441 error = Success; 1442 } 1443 1444 return error; 1445} 1446 1447void 1448__glXDisp_PixelMapfv(GLbyte * pc) 1449{ 1450 const GLsizei mapsize = *(GLsizei *) (pc + 4); 1451 1452 glPixelMapfv(*(GLenum *) (pc + 0), mapsize, (const GLfloat *) (pc + 8)); 1453} 1454 1455void 1456__glXDisp_PixelMapuiv(GLbyte * pc) 1457{ 1458 const GLsizei mapsize = *(GLsizei *) (pc + 4); 1459 1460 glPixelMapuiv(*(GLenum *) (pc + 0), mapsize, (const GLuint *) (pc + 8)); 1461} 1462 1463void 1464__glXDisp_PixelMapusv(GLbyte * pc) 1465{ 1466 const GLsizei mapsize = *(GLsizei *) (pc + 4); 1467 1468 glPixelMapusv(*(GLenum *) (pc + 0), mapsize, (const GLushort *) (pc + 8)); 1469} 1470 1471void 1472__glXDisp_ReadBuffer(GLbyte * pc) 1473{ 1474 glReadBuffer(*(GLenum *) (pc + 0)); 1475} 1476 1477void 1478__glXDisp_CopyPixels(GLbyte * pc) 1479{ 1480 glCopyPixels(*(GLint *) (pc + 0), 1481 *(GLint *) (pc + 4), 1482 *(GLsizei *) (pc + 8), 1483 *(GLsizei *) (pc + 12), *(GLenum *) (pc + 16)); 1484} 1485 1486void 1487__glXDisp_DrawPixels(GLbyte * pc) 1488{ 1489 const GLvoid *const pixels = (const GLvoid *) ((pc + 36)); 1490 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 1491 1492 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 1493 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 1494 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 1495 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 1496 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 1497 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 1498 1499 glDrawPixels(*(GLsizei *) (pc + 20), 1500 *(GLsizei *) (pc + 24), 1501 *(GLenum *) (pc + 28), *(GLenum *) (pc + 32), pixels); 1502} 1503 1504int 1505__glXDisp_GetBooleanv(__GLXclientState * cl, GLbyte * pc) 1506{ 1507 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1508 int error; 1509 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1510 1511 pc += __GLX_SINGLE_HDR_SIZE; 1512 if (cx != NULL) { 1513 const GLenum pname = *(GLenum *) (pc + 0); 1514 1515 const GLuint compsize = __glGetBooleanv_size(pname); 1516 GLboolean answerBuffer[200]; 1517 GLboolean *params = 1518 __glXGetAnswerBuffer(cl, compsize, answerBuffer, 1519 sizeof(answerBuffer), 1); 1520 1521 if (params == NULL) 1522 return BadAlloc; 1523 __glXClearErrorOccured(); 1524 1525 glGetBooleanv(pname, params); 1526 __glXSendReply(cl->client, params, compsize, 1, GL_FALSE, 0); 1527 error = Success; 1528 } 1529 1530 return error; 1531} 1532 1533int 1534__glXDisp_GetClipPlane(__GLXclientState * cl, GLbyte * pc) 1535{ 1536 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1537 int error; 1538 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1539 1540 pc += __GLX_SINGLE_HDR_SIZE; 1541 if (cx != NULL) { 1542 GLdouble equation[4]; 1543 1544 glGetClipPlane(*(GLenum *) (pc + 0), equation); 1545 __glXSendReply(cl->client, equation, 4, 8, GL_TRUE, 0); 1546 error = Success; 1547 } 1548 1549 return error; 1550} 1551 1552int 1553__glXDisp_GetDoublev(__GLXclientState * cl, GLbyte * pc) 1554{ 1555 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1556 int error; 1557 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1558 1559 pc += __GLX_SINGLE_HDR_SIZE; 1560 if (cx != NULL) { 1561 const GLenum pname = *(GLenum *) (pc + 0); 1562 1563 const GLuint compsize = __glGetDoublev_size(pname); 1564 GLdouble answerBuffer[200]; 1565 GLdouble *params = 1566 __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, 1567 sizeof(answerBuffer), 8); 1568 1569 if (params == NULL) 1570 return BadAlloc; 1571 __glXClearErrorOccured(); 1572 1573 glGetDoublev(pname, params); 1574 __glXSendReply(cl->client, params, compsize, 8, GL_FALSE, 0); 1575 error = Success; 1576 } 1577 1578 return error; 1579} 1580 1581int 1582__glXDisp_GetError(__GLXclientState * cl, GLbyte * pc) 1583{ 1584 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1585 int error; 1586 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1587 1588 pc += __GLX_SINGLE_HDR_SIZE; 1589 if (cx != NULL) { 1590 GLenum retval; 1591 1592 retval = glGetError(); 1593 __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 1594 error = Success; 1595 } 1596 1597 return error; 1598} 1599 1600int 1601__glXDisp_GetFloatv(__GLXclientState * cl, GLbyte * pc) 1602{ 1603 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1604 int error; 1605 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1606 1607 pc += __GLX_SINGLE_HDR_SIZE; 1608 if (cx != NULL) { 1609 const GLenum pname = *(GLenum *) (pc + 0); 1610 1611 const GLuint compsize = __glGetFloatv_size(pname); 1612 GLfloat answerBuffer[200]; 1613 GLfloat *params = 1614 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1615 sizeof(answerBuffer), 4); 1616 1617 if (params == NULL) 1618 return BadAlloc; 1619 __glXClearErrorOccured(); 1620 1621 glGetFloatv(pname, params); 1622 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 1623 error = Success; 1624 } 1625 1626 return error; 1627} 1628 1629int 1630__glXDisp_GetIntegerv(__GLXclientState * cl, GLbyte * pc) 1631{ 1632 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1633 int error; 1634 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1635 1636 pc += __GLX_SINGLE_HDR_SIZE; 1637 if (cx != NULL) { 1638 const GLenum pname = *(GLenum *) (pc + 0); 1639 1640 const GLuint compsize = __glGetIntegerv_size(pname); 1641 GLint answerBuffer[200]; 1642 GLint *params = 1643 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1644 sizeof(answerBuffer), 4); 1645 1646 if (params == NULL) 1647 return BadAlloc; 1648 __glXClearErrorOccured(); 1649 1650 glGetIntegerv(pname, params); 1651 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 1652 error = Success; 1653 } 1654 1655 return error; 1656} 1657 1658int 1659__glXDisp_GetLightfv(__GLXclientState * cl, GLbyte * pc) 1660{ 1661 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1662 int error; 1663 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1664 1665 pc += __GLX_SINGLE_HDR_SIZE; 1666 if (cx != NULL) { 1667 const GLenum pname = *(GLenum *) (pc + 4); 1668 1669 const GLuint compsize = __glGetLightfv_size(pname); 1670 GLfloat answerBuffer[200]; 1671 GLfloat *params = 1672 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1673 sizeof(answerBuffer), 4); 1674 1675 if (params == NULL) 1676 return BadAlloc; 1677 __glXClearErrorOccured(); 1678 1679 glGetLightfv(*(GLenum *) (pc + 0), pname, params); 1680 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 1681 error = Success; 1682 } 1683 1684 return error; 1685} 1686 1687int 1688__glXDisp_GetLightiv(__GLXclientState * cl, GLbyte * pc) 1689{ 1690 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1691 int error; 1692 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1693 1694 pc += __GLX_SINGLE_HDR_SIZE; 1695 if (cx != NULL) { 1696 const GLenum pname = *(GLenum *) (pc + 4); 1697 1698 const GLuint compsize = __glGetLightiv_size(pname); 1699 GLint answerBuffer[200]; 1700 GLint *params = 1701 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1702 sizeof(answerBuffer), 4); 1703 1704 if (params == NULL) 1705 return BadAlloc; 1706 __glXClearErrorOccured(); 1707 1708 glGetLightiv(*(GLenum *) (pc + 0), pname, params); 1709 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 1710 error = Success; 1711 } 1712 1713 return error; 1714} 1715 1716int 1717__glXDisp_GetMapdv(__GLXclientState * cl, GLbyte * pc) 1718{ 1719 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1720 int error; 1721 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1722 1723 pc += __GLX_SINGLE_HDR_SIZE; 1724 if (cx != NULL) { 1725 const GLenum target = *(GLenum *) (pc + 0); 1726 const GLenum query = *(GLenum *) (pc + 4); 1727 1728 const GLuint compsize = __glGetMapdv_size(target, query); 1729 GLdouble answerBuffer[200]; 1730 GLdouble *v = 1731 __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, 1732 sizeof(answerBuffer), 8); 1733 1734 if (v == NULL) 1735 return BadAlloc; 1736 __glXClearErrorOccured(); 1737 1738 glGetMapdv(target, query, v); 1739 __glXSendReply(cl->client, v, compsize, 8, GL_FALSE, 0); 1740 error = Success; 1741 } 1742 1743 return error; 1744} 1745 1746int 1747__glXDisp_GetMapfv(__GLXclientState * cl, GLbyte * pc) 1748{ 1749 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1750 int error; 1751 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1752 1753 pc += __GLX_SINGLE_HDR_SIZE; 1754 if (cx != NULL) { 1755 const GLenum target = *(GLenum *) (pc + 0); 1756 const GLenum query = *(GLenum *) (pc + 4); 1757 1758 const GLuint compsize = __glGetMapfv_size(target, query); 1759 GLfloat answerBuffer[200]; 1760 GLfloat *v = 1761 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1762 sizeof(answerBuffer), 4); 1763 1764 if (v == NULL) 1765 return BadAlloc; 1766 __glXClearErrorOccured(); 1767 1768 glGetMapfv(target, query, v); 1769 __glXSendReply(cl->client, v, compsize, 4, GL_FALSE, 0); 1770 error = Success; 1771 } 1772 1773 return error; 1774} 1775 1776int 1777__glXDisp_GetMapiv(__GLXclientState * cl, GLbyte * pc) 1778{ 1779 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1780 int error; 1781 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1782 1783 pc += __GLX_SINGLE_HDR_SIZE; 1784 if (cx != NULL) { 1785 const GLenum target = *(GLenum *) (pc + 0); 1786 const GLenum query = *(GLenum *) (pc + 4); 1787 1788 const GLuint compsize = __glGetMapiv_size(target, query); 1789 GLint answerBuffer[200]; 1790 GLint *v = 1791 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1792 sizeof(answerBuffer), 4); 1793 1794 if (v == NULL) 1795 return BadAlloc; 1796 __glXClearErrorOccured(); 1797 1798 glGetMapiv(target, query, v); 1799 __glXSendReply(cl->client, v, compsize, 4, GL_FALSE, 0); 1800 error = Success; 1801 } 1802 1803 return error; 1804} 1805 1806int 1807__glXDisp_GetMaterialfv(__GLXclientState * cl, GLbyte * pc) 1808{ 1809 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1810 int error; 1811 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1812 1813 pc += __GLX_SINGLE_HDR_SIZE; 1814 if (cx != NULL) { 1815 const GLenum pname = *(GLenum *) (pc + 4); 1816 1817 const GLuint compsize = __glGetMaterialfv_size(pname); 1818 GLfloat answerBuffer[200]; 1819 GLfloat *params = 1820 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1821 sizeof(answerBuffer), 4); 1822 1823 if (params == NULL) 1824 return BadAlloc; 1825 __glXClearErrorOccured(); 1826 1827 glGetMaterialfv(*(GLenum *) (pc + 0), pname, params); 1828 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 1829 error = Success; 1830 } 1831 1832 return error; 1833} 1834 1835int 1836__glXDisp_GetMaterialiv(__GLXclientState * cl, GLbyte * pc) 1837{ 1838 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1839 int error; 1840 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1841 1842 pc += __GLX_SINGLE_HDR_SIZE; 1843 if (cx != NULL) { 1844 const GLenum pname = *(GLenum *) (pc + 4); 1845 1846 const GLuint compsize = __glGetMaterialiv_size(pname); 1847 GLint answerBuffer[200]; 1848 GLint *params = 1849 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1850 sizeof(answerBuffer), 4); 1851 1852 if (params == NULL) 1853 return BadAlloc; 1854 __glXClearErrorOccured(); 1855 1856 glGetMaterialiv(*(GLenum *) (pc + 0), pname, params); 1857 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 1858 error = Success; 1859 } 1860 1861 return error; 1862} 1863 1864int 1865__glXDisp_GetPixelMapfv(__GLXclientState * cl, GLbyte * pc) 1866{ 1867 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1868 int error; 1869 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1870 1871 pc += __GLX_SINGLE_HDR_SIZE; 1872 if (cx != NULL) { 1873 const GLenum map = *(GLenum *) (pc + 0); 1874 1875 const GLuint compsize = __glGetPixelMapfv_size(map); 1876 GLfloat answerBuffer[200]; 1877 GLfloat *values = 1878 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1879 sizeof(answerBuffer), 4); 1880 1881 if (values == NULL) 1882 return BadAlloc; 1883 __glXClearErrorOccured(); 1884 1885 glGetPixelMapfv(map, values); 1886 __glXSendReply(cl->client, values, compsize, 4, GL_FALSE, 0); 1887 error = Success; 1888 } 1889 1890 return error; 1891} 1892 1893int 1894__glXDisp_GetPixelMapuiv(__GLXclientState * cl, GLbyte * pc) 1895{ 1896 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1897 int error; 1898 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1899 1900 pc += __GLX_SINGLE_HDR_SIZE; 1901 if (cx != NULL) { 1902 const GLenum map = *(GLenum *) (pc + 0); 1903 1904 const GLuint compsize = __glGetPixelMapuiv_size(map); 1905 GLuint answerBuffer[200]; 1906 GLuint *values = 1907 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1908 sizeof(answerBuffer), 4); 1909 1910 if (values == NULL) 1911 return BadAlloc; 1912 __glXClearErrorOccured(); 1913 1914 glGetPixelMapuiv(map, values); 1915 __glXSendReply(cl->client, values, compsize, 4, GL_FALSE, 0); 1916 error = Success; 1917 } 1918 1919 return error; 1920} 1921 1922int 1923__glXDisp_GetPixelMapusv(__GLXclientState * cl, GLbyte * pc) 1924{ 1925 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1926 int error; 1927 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1928 1929 pc += __GLX_SINGLE_HDR_SIZE; 1930 if (cx != NULL) { 1931 const GLenum map = *(GLenum *) (pc + 0); 1932 1933 const GLuint compsize = __glGetPixelMapusv_size(map); 1934 GLushort answerBuffer[200]; 1935 GLushort *values = 1936 __glXGetAnswerBuffer(cl, compsize * 2, answerBuffer, 1937 sizeof(answerBuffer), 2); 1938 1939 if (values == NULL) 1940 return BadAlloc; 1941 __glXClearErrorOccured(); 1942 1943 glGetPixelMapusv(map, values); 1944 __glXSendReply(cl->client, values, compsize, 2, GL_FALSE, 0); 1945 error = Success; 1946 } 1947 1948 return error; 1949} 1950 1951int 1952__glXDisp_GetTexEnvfv(__GLXclientState * cl, GLbyte * pc) 1953{ 1954 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1955 int error; 1956 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1957 1958 pc += __GLX_SINGLE_HDR_SIZE; 1959 if (cx != NULL) { 1960 const GLenum pname = *(GLenum *) (pc + 4); 1961 1962 const GLuint compsize = __glGetTexEnvfv_size(pname); 1963 GLfloat answerBuffer[200]; 1964 GLfloat *params = 1965 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1966 sizeof(answerBuffer), 4); 1967 1968 if (params == NULL) 1969 return BadAlloc; 1970 __glXClearErrorOccured(); 1971 1972 glGetTexEnvfv(*(GLenum *) (pc + 0), pname, params); 1973 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 1974 error = Success; 1975 } 1976 1977 return error; 1978} 1979 1980int 1981__glXDisp_GetTexEnviv(__GLXclientState * cl, GLbyte * pc) 1982{ 1983 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1984 int error; 1985 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 1986 1987 pc += __GLX_SINGLE_HDR_SIZE; 1988 if (cx != NULL) { 1989 const GLenum pname = *(GLenum *) (pc + 4); 1990 1991 const GLuint compsize = __glGetTexEnviv_size(pname); 1992 GLint answerBuffer[200]; 1993 GLint *params = 1994 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1995 sizeof(answerBuffer), 4); 1996 1997 if (params == NULL) 1998 return BadAlloc; 1999 __glXClearErrorOccured(); 2000 2001 glGetTexEnviv(*(GLenum *) (pc + 0), pname, params); 2002 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 2003 error = Success; 2004 } 2005 2006 return error; 2007} 2008 2009int 2010__glXDisp_GetTexGendv(__GLXclientState * cl, GLbyte * pc) 2011{ 2012 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2013 int error; 2014 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2015 2016 pc += __GLX_SINGLE_HDR_SIZE; 2017 if (cx != NULL) { 2018 const GLenum pname = *(GLenum *) (pc + 4); 2019 2020 const GLuint compsize = __glGetTexGendv_size(pname); 2021 GLdouble answerBuffer[200]; 2022 GLdouble *params = 2023 __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, 2024 sizeof(answerBuffer), 8); 2025 2026 if (params == NULL) 2027 return BadAlloc; 2028 __glXClearErrorOccured(); 2029 2030 glGetTexGendv(*(GLenum *) (pc + 0), pname, params); 2031 __glXSendReply(cl->client, params, compsize, 8, GL_FALSE, 0); 2032 error = Success; 2033 } 2034 2035 return error; 2036} 2037 2038int 2039__glXDisp_GetTexGenfv(__GLXclientState * cl, GLbyte * pc) 2040{ 2041 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2042 int error; 2043 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2044 2045 pc += __GLX_SINGLE_HDR_SIZE; 2046 if (cx != NULL) { 2047 const GLenum pname = *(GLenum *) (pc + 4); 2048 2049 const GLuint compsize = __glGetTexGenfv_size(pname); 2050 GLfloat answerBuffer[200]; 2051 GLfloat *params = 2052 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2053 sizeof(answerBuffer), 4); 2054 2055 if (params == NULL) 2056 return BadAlloc; 2057 __glXClearErrorOccured(); 2058 2059 glGetTexGenfv(*(GLenum *) (pc + 0), pname, params); 2060 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 2061 error = Success; 2062 } 2063 2064 return error; 2065} 2066 2067int 2068__glXDisp_GetTexGeniv(__GLXclientState * cl, GLbyte * pc) 2069{ 2070 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2071 int error; 2072 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2073 2074 pc += __GLX_SINGLE_HDR_SIZE; 2075 if (cx != NULL) { 2076 const GLenum pname = *(GLenum *) (pc + 4); 2077 2078 const GLuint compsize = __glGetTexGeniv_size(pname); 2079 GLint answerBuffer[200]; 2080 GLint *params = 2081 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2082 sizeof(answerBuffer), 4); 2083 2084 if (params == NULL) 2085 return BadAlloc; 2086 __glXClearErrorOccured(); 2087 2088 glGetTexGeniv(*(GLenum *) (pc + 0), pname, params); 2089 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 2090 error = Success; 2091 } 2092 2093 return error; 2094} 2095 2096int 2097__glXDisp_GetTexParameterfv(__GLXclientState * cl, GLbyte * pc) 2098{ 2099 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2100 int error; 2101 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2102 2103 pc += __GLX_SINGLE_HDR_SIZE; 2104 if (cx != NULL) { 2105 const GLenum pname = *(GLenum *) (pc + 4); 2106 2107 const GLuint compsize = __glGetTexParameterfv_size(pname); 2108 GLfloat answerBuffer[200]; 2109 GLfloat *params = 2110 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2111 sizeof(answerBuffer), 4); 2112 2113 if (params == NULL) 2114 return BadAlloc; 2115 __glXClearErrorOccured(); 2116 2117 glGetTexParameterfv(*(GLenum *) (pc + 0), pname, params); 2118 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 2119 error = Success; 2120 } 2121 2122 return error; 2123} 2124 2125int 2126__glXDisp_GetTexParameteriv(__GLXclientState * cl, GLbyte * pc) 2127{ 2128 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2129 int error; 2130 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2131 2132 pc += __GLX_SINGLE_HDR_SIZE; 2133 if (cx != NULL) { 2134 const GLenum pname = *(GLenum *) (pc + 4); 2135 2136 const GLuint compsize = __glGetTexParameteriv_size(pname); 2137 GLint answerBuffer[200]; 2138 GLint *params = 2139 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2140 sizeof(answerBuffer), 4); 2141 2142 if (params == NULL) 2143 return BadAlloc; 2144 __glXClearErrorOccured(); 2145 2146 glGetTexParameteriv(*(GLenum *) (pc + 0), pname, params); 2147 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 2148 error = Success; 2149 } 2150 2151 return error; 2152} 2153 2154int 2155__glXDisp_GetTexLevelParameterfv(__GLXclientState * cl, GLbyte * pc) 2156{ 2157 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2158 int error; 2159 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2160 2161 pc += __GLX_SINGLE_HDR_SIZE; 2162 if (cx != NULL) { 2163 const GLenum pname = *(GLenum *) (pc + 8); 2164 2165 const GLuint compsize = __glGetTexLevelParameterfv_size(pname); 2166 GLfloat answerBuffer[200]; 2167 GLfloat *params = 2168 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2169 sizeof(answerBuffer), 4); 2170 2171 if (params == NULL) 2172 return BadAlloc; 2173 __glXClearErrorOccured(); 2174 2175 glGetTexLevelParameterfv(*(GLenum *) (pc + 0), 2176 *(GLint *) (pc + 4), pname, params); 2177 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 2178 error = Success; 2179 } 2180 2181 return error; 2182} 2183 2184int 2185__glXDisp_GetTexLevelParameteriv(__GLXclientState * cl, GLbyte * pc) 2186{ 2187 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2188 int error; 2189 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2190 2191 pc += __GLX_SINGLE_HDR_SIZE; 2192 if (cx != NULL) { 2193 const GLenum pname = *(GLenum *) (pc + 8); 2194 2195 const GLuint compsize = __glGetTexLevelParameteriv_size(pname); 2196 GLint answerBuffer[200]; 2197 GLint *params = 2198 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2199 sizeof(answerBuffer), 4); 2200 2201 if (params == NULL) 2202 return BadAlloc; 2203 __glXClearErrorOccured(); 2204 2205 glGetTexLevelParameteriv(*(GLenum *) (pc + 0), 2206 *(GLint *) (pc + 4), pname, params); 2207 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 2208 error = Success; 2209 } 2210 2211 return error; 2212} 2213 2214int 2215__glXDisp_IsEnabled(__GLXclientState * cl, GLbyte * pc) 2216{ 2217 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2218 int error; 2219 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2220 2221 pc += __GLX_SINGLE_HDR_SIZE; 2222 if (cx != NULL) { 2223 GLboolean retval; 2224 2225 retval = glIsEnabled(*(GLenum *) (pc + 0)); 2226 __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 2227 error = Success; 2228 } 2229 2230 return error; 2231} 2232 2233int 2234__glXDisp_IsList(__GLXclientState * cl, GLbyte * pc) 2235{ 2236 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2237 int error; 2238 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2239 2240 pc += __GLX_SINGLE_HDR_SIZE; 2241 if (cx != NULL) { 2242 GLboolean retval; 2243 2244 retval = glIsList(*(GLuint *) (pc + 0)); 2245 __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 2246 error = Success; 2247 } 2248 2249 return error; 2250} 2251 2252void 2253__glXDisp_DepthRange(GLbyte * pc) 2254{ 2255#ifdef __GLX_ALIGN64 2256 if ((unsigned long) (pc) & 7) { 2257 (void) memmove(pc - 4, pc, 16); 2258 pc -= 4; 2259 } 2260#endif 2261 2262 glDepthRange(*(GLclampd *) (pc + 0), *(GLclampd *) (pc + 8)); 2263} 2264 2265void 2266__glXDisp_Frustum(GLbyte * pc) 2267{ 2268#ifdef __GLX_ALIGN64 2269 if ((unsigned long) (pc) & 7) { 2270 (void) memmove(pc - 4, pc, 48); 2271 pc -= 4; 2272 } 2273#endif 2274 2275 glFrustum(*(GLdouble *) (pc + 0), 2276 *(GLdouble *) (pc + 8), 2277 *(GLdouble *) (pc + 16), 2278 *(GLdouble *) (pc + 24), 2279 *(GLdouble *) (pc + 32), *(GLdouble *) (pc + 40)); 2280} 2281 2282void 2283__glXDisp_LoadIdentity(GLbyte * pc) 2284{ 2285 glLoadIdentity(); 2286} 2287 2288void 2289__glXDisp_LoadMatrixf(GLbyte * pc) 2290{ 2291 glLoadMatrixf((const GLfloat *) (pc + 0)); 2292} 2293 2294void 2295__glXDisp_LoadMatrixd(GLbyte * pc) 2296{ 2297#ifdef __GLX_ALIGN64 2298 if ((unsigned long) (pc) & 7) { 2299 (void) memmove(pc - 4, pc, 128); 2300 pc -= 4; 2301 } 2302#endif 2303 2304 glLoadMatrixd((const GLdouble *) (pc + 0)); 2305} 2306 2307void 2308__glXDisp_MatrixMode(GLbyte * pc) 2309{ 2310 glMatrixMode(*(GLenum *) (pc + 0)); 2311} 2312 2313void 2314__glXDisp_MultMatrixf(GLbyte * pc) 2315{ 2316 glMultMatrixf((const GLfloat *) (pc + 0)); 2317} 2318 2319void 2320__glXDisp_MultMatrixd(GLbyte * pc) 2321{ 2322#ifdef __GLX_ALIGN64 2323 if ((unsigned long) (pc) & 7) { 2324 (void) memmove(pc - 4, pc, 128); 2325 pc -= 4; 2326 } 2327#endif 2328 2329 glMultMatrixd((const GLdouble *) (pc + 0)); 2330} 2331 2332void 2333__glXDisp_Ortho(GLbyte * pc) 2334{ 2335#ifdef __GLX_ALIGN64 2336 if ((unsigned long) (pc) & 7) { 2337 (void) memmove(pc - 4, pc, 48); 2338 pc -= 4; 2339 } 2340#endif 2341 2342 glOrtho(*(GLdouble *) (pc + 0), 2343 *(GLdouble *) (pc + 8), 2344 *(GLdouble *) (pc + 16), 2345 *(GLdouble *) (pc + 24), 2346 *(GLdouble *) (pc + 32), *(GLdouble *) (pc + 40)); 2347} 2348 2349void 2350__glXDisp_PopMatrix(GLbyte * pc) 2351{ 2352 glPopMatrix(); 2353} 2354 2355void 2356__glXDisp_PushMatrix(GLbyte * pc) 2357{ 2358 glPushMatrix(); 2359} 2360 2361void 2362__glXDisp_Rotated(GLbyte * pc) 2363{ 2364#ifdef __GLX_ALIGN64 2365 if ((unsigned long) (pc) & 7) { 2366 (void) memmove(pc - 4, pc, 32); 2367 pc -= 4; 2368 } 2369#endif 2370 2371 glRotated(*(GLdouble *) (pc + 0), 2372 *(GLdouble *) (pc + 8), 2373 *(GLdouble *) (pc + 16), *(GLdouble *) (pc + 24)); 2374} 2375 2376void 2377__glXDisp_Rotatef(GLbyte * pc) 2378{ 2379 glRotatef(*(GLfloat *) (pc + 0), 2380 *(GLfloat *) (pc + 4), 2381 *(GLfloat *) (pc + 8), *(GLfloat *) (pc + 12)); 2382} 2383 2384void 2385__glXDisp_Scaled(GLbyte * pc) 2386{ 2387#ifdef __GLX_ALIGN64 2388 if ((unsigned long) (pc) & 7) { 2389 (void) memmove(pc - 4, pc, 24); 2390 pc -= 4; 2391 } 2392#endif 2393 2394 glScaled(*(GLdouble *) (pc + 0), 2395 *(GLdouble *) (pc + 8), *(GLdouble *) (pc + 16)); 2396} 2397 2398void 2399__glXDisp_Scalef(GLbyte * pc) 2400{ 2401 glScalef(*(GLfloat *) (pc + 0), 2402 *(GLfloat *) (pc + 4), *(GLfloat *) (pc + 8)); 2403} 2404 2405void 2406__glXDisp_Translated(GLbyte * pc) 2407{ 2408#ifdef __GLX_ALIGN64 2409 if ((unsigned long) (pc) & 7) { 2410 (void) memmove(pc - 4, pc, 24); 2411 pc -= 4; 2412 } 2413#endif 2414 2415 glTranslated(*(GLdouble *) (pc + 0), 2416 *(GLdouble *) (pc + 8), *(GLdouble *) (pc + 16)); 2417} 2418 2419void 2420__glXDisp_Translatef(GLbyte * pc) 2421{ 2422 glTranslatef(*(GLfloat *) (pc + 0), 2423 *(GLfloat *) (pc + 4), *(GLfloat *) (pc + 8)); 2424} 2425 2426void 2427__glXDisp_Viewport(GLbyte * pc) 2428{ 2429 glViewport(*(GLint *) (pc + 0), 2430 *(GLint *) (pc + 4), 2431 *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12)); 2432} 2433 2434void 2435__glXDisp_BindTexture(GLbyte * pc) 2436{ 2437 glBindTexture(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); 2438} 2439 2440void 2441__glXDisp_Indexubv(GLbyte * pc) 2442{ 2443 glIndexubv((const GLubyte *) (pc + 0)); 2444} 2445 2446void 2447__glXDisp_PolygonOffset(GLbyte * pc) 2448{ 2449 glPolygonOffset(*(GLfloat *) (pc + 0), *(GLfloat *) (pc + 4)); 2450} 2451 2452int 2453__glXDisp_AreTexturesResident(__GLXclientState * cl, GLbyte * pc) 2454{ 2455 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2456 int error; 2457 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2458 2459 pc += __GLX_SINGLE_HDR_SIZE; 2460 if (cx != NULL) { 2461 const GLsizei n = *(GLsizei *) (pc + 0); 2462 2463 GLboolean retval; 2464 GLboolean answerBuffer[200]; 2465 GLboolean *residences = 2466 __glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1); 2467 2468 if (residences == NULL) 2469 return BadAlloc; 2470 retval = 2471 glAreTexturesResident(n, (const GLuint *) (pc + 4), residences); 2472 __glXSendReply(cl->client, residences, n, 1, GL_TRUE, retval); 2473 error = Success; 2474 } 2475 2476 return error; 2477} 2478 2479int 2480__glXDisp_AreTexturesResidentEXT(__GLXclientState * cl, GLbyte * pc) 2481{ 2482 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 2483 int error; 2484 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2485 2486 pc += __GLX_VENDPRIV_HDR_SIZE; 2487 if (cx != NULL) { 2488 const GLsizei n = *(GLsizei *) (pc + 0); 2489 2490 GLboolean retval; 2491 GLboolean answerBuffer[200]; 2492 GLboolean *residences = 2493 __glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1); 2494 2495 if (residences == NULL) 2496 return BadAlloc; 2497 retval = 2498 glAreTexturesResident(n, (const GLuint *) (pc + 4), residences); 2499 __glXSendReply(cl->client, residences, n, 1, GL_TRUE, retval); 2500 error = Success; 2501 } 2502 2503 return error; 2504} 2505 2506void 2507__glXDisp_CopyTexImage1D(GLbyte * pc) 2508{ 2509 glCopyTexImage1D(*(GLenum *) (pc + 0), 2510 *(GLint *) (pc + 4), 2511 *(GLenum *) (pc + 8), 2512 *(GLint *) (pc + 12), 2513 *(GLint *) (pc + 16), 2514 *(GLsizei *) (pc + 20), *(GLint *) (pc + 24)); 2515} 2516 2517void 2518__glXDisp_CopyTexImage2D(GLbyte * pc) 2519{ 2520 glCopyTexImage2D(*(GLenum *) (pc + 0), 2521 *(GLint *) (pc + 4), 2522 *(GLenum *) (pc + 8), 2523 *(GLint *) (pc + 12), 2524 *(GLint *) (pc + 16), 2525 *(GLsizei *) (pc + 20), 2526 *(GLsizei *) (pc + 24), *(GLint *) (pc + 28)); 2527} 2528 2529void 2530__glXDisp_CopyTexSubImage1D(GLbyte * pc) 2531{ 2532 glCopyTexSubImage1D(*(GLenum *) (pc + 0), 2533 *(GLint *) (pc + 4), 2534 *(GLint *) (pc + 8), 2535 *(GLint *) (pc + 12), 2536 *(GLint *) (pc + 16), *(GLsizei *) (pc + 20)); 2537} 2538 2539void 2540__glXDisp_CopyTexSubImage2D(GLbyte * pc) 2541{ 2542 glCopyTexSubImage2D(*(GLenum *) (pc + 0), 2543 *(GLint *) (pc + 4), 2544 *(GLint *) (pc + 8), 2545 *(GLint *) (pc + 12), 2546 *(GLint *) (pc + 16), 2547 *(GLint *) (pc + 20), 2548 *(GLsizei *) (pc + 24), *(GLsizei *) (pc + 28)); 2549} 2550 2551int 2552__glXDisp_DeleteTextures(__GLXclientState * cl, GLbyte * pc) 2553{ 2554 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2555 int error; 2556 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2557 2558 pc += __GLX_SINGLE_HDR_SIZE; 2559 if (cx != NULL) { 2560 const GLsizei n = *(GLsizei *) (pc + 0); 2561 2562 glDeleteTextures(n, (const GLuint *) (pc + 4)); 2563 error = Success; 2564 } 2565 2566 return error; 2567} 2568 2569int 2570__glXDisp_DeleteTexturesEXT(__GLXclientState * cl, GLbyte * pc) 2571{ 2572 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 2573 int error; 2574 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2575 2576 pc += __GLX_VENDPRIV_HDR_SIZE; 2577 if (cx != NULL) { 2578 const GLsizei n = *(GLsizei *) (pc + 0); 2579 2580 glDeleteTextures(n, (const GLuint *) (pc + 4)); 2581 error = Success; 2582 } 2583 2584 return error; 2585} 2586 2587int 2588__glXDisp_GenTextures(__GLXclientState * cl, GLbyte * pc) 2589{ 2590 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2591 int error; 2592 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2593 2594 pc += __GLX_SINGLE_HDR_SIZE; 2595 if (cx != NULL) { 2596 const GLsizei n = *(GLsizei *) (pc + 0); 2597 2598 GLuint answerBuffer[200]; 2599 GLuint *textures = 2600 __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 2601 4); 2602 2603 if (textures == NULL) 2604 return BadAlloc; 2605 glGenTextures(n, textures); 2606 __glXSendReply(cl->client, textures, n, 4, GL_TRUE, 0); 2607 error = Success; 2608 } 2609 2610 return error; 2611} 2612 2613int 2614__glXDisp_GenTexturesEXT(__GLXclientState * cl, GLbyte * pc) 2615{ 2616 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 2617 int error; 2618 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2619 2620 pc += __GLX_VENDPRIV_HDR_SIZE; 2621 if (cx != NULL) { 2622 const GLsizei n = *(GLsizei *) (pc + 0); 2623 2624 GLuint answerBuffer[200]; 2625 GLuint *textures = 2626 __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 2627 4); 2628 2629 if (textures == NULL) 2630 return BadAlloc; 2631 glGenTextures(n, textures); 2632 __glXSendReply(cl->client, textures, n, 4, GL_TRUE, 0); 2633 error = Success; 2634 } 2635 2636 return error; 2637} 2638 2639int 2640__glXDisp_IsTexture(__GLXclientState * cl, GLbyte * pc) 2641{ 2642 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2643 int error; 2644 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2645 2646 pc += __GLX_SINGLE_HDR_SIZE; 2647 if (cx != NULL) { 2648 GLboolean retval; 2649 2650 retval = glIsTexture(*(GLuint *) (pc + 0)); 2651 __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 2652 error = Success; 2653 } 2654 2655 return error; 2656} 2657 2658int 2659__glXDisp_IsTextureEXT(__GLXclientState * cl, GLbyte * pc) 2660{ 2661 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 2662 int error; 2663 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2664 2665 pc += __GLX_VENDPRIV_HDR_SIZE; 2666 if (cx != NULL) { 2667 GLboolean retval; 2668 2669 retval = glIsTexture(*(GLuint *) (pc + 0)); 2670 __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 2671 error = Success; 2672 } 2673 2674 return error; 2675} 2676 2677void 2678__glXDisp_PrioritizeTextures(GLbyte * pc) 2679{ 2680 const GLsizei n = *(GLsizei *) (pc + 0); 2681 2682 glPrioritizeTextures(n, 2683 (const GLuint *) (pc + 4), 2684 (const GLclampf *) (pc + 4)); 2685} 2686 2687void 2688__glXDisp_TexSubImage1D(GLbyte * pc) 2689{ 2690 const GLvoid *const pixels = (const GLvoid *) ((pc + 56)); 2691 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 2692 2693 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 2694 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 2695 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 2696 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 2697 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 2698 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 2699 2700 glTexSubImage1D(*(GLenum *) (pc + 20), 2701 *(GLint *) (pc + 24), 2702 *(GLint *) (pc + 28), 2703 *(GLsizei *) (pc + 36), 2704 *(GLenum *) (pc + 44), *(GLenum *) (pc + 48), pixels); 2705} 2706 2707void 2708__glXDisp_TexSubImage2D(GLbyte * pc) 2709{ 2710 const GLvoid *const pixels = (const GLvoid *) ((pc + 56)); 2711 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 2712 2713 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 2714 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 2715 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 2716 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 2717 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 2718 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 2719 2720 glTexSubImage2D(*(GLenum *) (pc + 20), 2721 *(GLint *) (pc + 24), 2722 *(GLint *) (pc + 28), 2723 *(GLint *) (pc + 32), 2724 *(GLsizei *) (pc + 36), 2725 *(GLsizei *) (pc + 40), 2726 *(GLenum *) (pc + 44), *(GLenum *) (pc + 48), pixels); 2727} 2728 2729void 2730__glXDisp_BlendColor(GLbyte * pc) 2731{ 2732 glBlendColor(*(GLclampf *) (pc + 0), 2733 *(GLclampf *) (pc + 4), 2734 *(GLclampf *) (pc + 8), *(GLclampf *) (pc + 12)); 2735} 2736 2737void 2738__glXDisp_BlendEquation(GLbyte * pc) 2739{ 2740 glBlendEquation(*(GLenum *) (pc + 0)); 2741} 2742 2743void 2744__glXDisp_ColorTable(GLbyte * pc) 2745{ 2746 const GLvoid *const table = (const GLvoid *) ((pc + 40)); 2747 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 2748 2749 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 2750 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 2751 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 2752 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 2753 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 2754 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 2755 2756 glColorTable(*(GLenum *) (pc + 20), 2757 *(GLenum *) (pc + 24), 2758 *(GLsizei *) (pc + 28), 2759 *(GLenum *) (pc + 32), *(GLenum *) (pc + 36), table); 2760} 2761 2762void 2763__glXDisp_ColorTableParameterfv(GLbyte * pc) 2764{ 2765 const GLenum pname = *(GLenum *) (pc + 4); 2766 const GLfloat *params; 2767 2768 params = (const GLfloat *) (pc + 8); 2769 2770 glColorTableParameterfv(*(GLenum *) (pc + 0), pname, params); 2771} 2772 2773void 2774__glXDisp_ColorTableParameteriv(GLbyte * pc) 2775{ 2776 const GLenum pname = *(GLenum *) (pc + 4); 2777 const GLint *params; 2778 2779 params = (const GLint *) (pc + 8); 2780 2781 glColorTableParameteriv(*(GLenum *) (pc + 0), pname, params); 2782} 2783 2784void 2785__glXDisp_CopyColorTable(GLbyte * pc) 2786{ 2787 glCopyColorTable(*(GLenum *) (pc + 0), 2788 *(GLenum *) (pc + 4), 2789 *(GLint *) (pc + 8), 2790 *(GLint *) (pc + 12), *(GLsizei *) (pc + 16)); 2791} 2792 2793int 2794__glXDisp_GetColorTableParameterfv(__GLXclientState * cl, GLbyte * pc) 2795{ 2796 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2797 int error; 2798 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2799 2800 pc += __GLX_SINGLE_HDR_SIZE; 2801 if (cx != NULL) { 2802 const GLenum pname = *(GLenum *) (pc + 4); 2803 2804 const GLuint compsize = __glGetColorTableParameterfv_size(pname); 2805 GLfloat answerBuffer[200]; 2806 GLfloat *params = 2807 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2808 sizeof(answerBuffer), 4); 2809 2810 if (params == NULL) 2811 return BadAlloc; 2812 __glXClearErrorOccured(); 2813 2814 glGetColorTableParameterfv(*(GLenum *) (pc + 0), pname, params); 2815 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 2816 error = Success; 2817 } 2818 2819 return error; 2820} 2821 2822int 2823__glXDisp_GetColorTableParameterfvSGI(__GLXclientState * cl, GLbyte * pc) 2824{ 2825 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 2826 int error; 2827 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2828 2829 pc += __GLX_VENDPRIV_HDR_SIZE; 2830 if (cx != NULL) { 2831 const GLenum pname = *(GLenum *) (pc + 4); 2832 2833 const GLuint compsize = __glGetColorTableParameterfv_size(pname); 2834 GLfloat answerBuffer[200]; 2835 GLfloat *params = 2836 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2837 sizeof(answerBuffer), 4); 2838 2839 if (params == NULL) 2840 return BadAlloc; 2841 __glXClearErrorOccured(); 2842 2843 glGetColorTableParameterfv(*(GLenum *) (pc + 0), pname, params); 2844 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 2845 error = Success; 2846 } 2847 2848 return error; 2849} 2850 2851int 2852__glXDisp_GetColorTableParameteriv(__GLXclientState * cl, GLbyte * pc) 2853{ 2854 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2855 int error; 2856 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2857 2858 pc += __GLX_SINGLE_HDR_SIZE; 2859 if (cx != NULL) { 2860 const GLenum pname = *(GLenum *) (pc + 4); 2861 2862 const GLuint compsize = __glGetColorTableParameteriv_size(pname); 2863 GLint answerBuffer[200]; 2864 GLint *params = 2865 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2866 sizeof(answerBuffer), 4); 2867 2868 if (params == NULL) 2869 return BadAlloc; 2870 __glXClearErrorOccured(); 2871 2872 glGetColorTableParameteriv(*(GLenum *) (pc + 0), pname, params); 2873 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 2874 error = Success; 2875 } 2876 2877 return error; 2878} 2879 2880int 2881__glXDisp_GetColorTableParameterivSGI(__GLXclientState * cl, GLbyte * pc) 2882{ 2883 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 2884 int error; 2885 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 2886 2887 pc += __GLX_VENDPRIV_HDR_SIZE; 2888 if (cx != NULL) { 2889 const GLenum pname = *(GLenum *) (pc + 4); 2890 2891 const GLuint compsize = __glGetColorTableParameteriv_size(pname); 2892 GLint answerBuffer[200]; 2893 GLint *params = 2894 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2895 sizeof(answerBuffer), 4); 2896 2897 if (params == NULL) 2898 return BadAlloc; 2899 __glXClearErrorOccured(); 2900 2901 glGetColorTableParameteriv(*(GLenum *) (pc + 0), pname, params); 2902 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 2903 error = Success; 2904 } 2905 2906 return error; 2907} 2908 2909void 2910__glXDisp_ColorSubTable(GLbyte * pc) 2911{ 2912 const GLvoid *const data = (const GLvoid *) ((pc + 40)); 2913 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 2914 2915 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 2916 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 2917 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 2918 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 2919 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 2920 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 2921 2922 glColorSubTable(*(GLenum *) (pc + 20), 2923 *(GLsizei *) (pc + 24), 2924 *(GLsizei *) (pc + 28), 2925 *(GLenum *) (pc + 32), *(GLenum *) (pc + 36), data); 2926} 2927 2928void 2929__glXDisp_CopyColorSubTable(GLbyte * pc) 2930{ 2931 glCopyColorSubTable(*(GLenum *) (pc + 0), 2932 *(GLsizei *) (pc + 4), 2933 *(GLint *) (pc + 8), 2934 *(GLint *) (pc + 12), *(GLsizei *) (pc + 16)); 2935} 2936 2937void 2938__glXDisp_ConvolutionFilter1D(GLbyte * pc) 2939{ 2940 const GLvoid *const image = (const GLvoid *) ((pc + 44)); 2941 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 2942 2943 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 2944 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 2945 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 2946 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 2947 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 2948 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 2949 2950 glConvolutionFilter1D(*(GLenum *) (pc + 20), 2951 *(GLenum *) (pc + 24), 2952 *(GLsizei *) (pc + 28), 2953 *(GLenum *) (pc + 36), *(GLenum *) (pc + 40), image); 2954} 2955 2956void 2957__glXDisp_ConvolutionFilter2D(GLbyte * pc) 2958{ 2959 const GLvoid *const image = (const GLvoid *) ((pc + 44)); 2960 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 2961 2962 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 2963 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 2964 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 2965 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 2966 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 2967 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 2968 2969 glConvolutionFilter2D(*(GLenum *) (pc + 20), 2970 *(GLenum *) (pc + 24), 2971 *(GLsizei *) (pc + 28), 2972 *(GLsizei *) (pc + 32), 2973 *(GLenum *) (pc + 36), *(GLenum *) (pc + 40), image); 2974} 2975 2976void 2977__glXDisp_ConvolutionParameterf(GLbyte * pc) 2978{ 2979 glConvolutionParameterf(*(GLenum *) (pc + 0), 2980 *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8)); 2981} 2982 2983void 2984__glXDisp_ConvolutionParameterfv(GLbyte * pc) 2985{ 2986 const GLenum pname = *(GLenum *) (pc + 4); 2987 const GLfloat *params; 2988 2989 params = (const GLfloat *) (pc + 8); 2990 2991 glConvolutionParameterfv(*(GLenum *) (pc + 0), pname, params); 2992} 2993 2994void 2995__glXDisp_ConvolutionParameteri(GLbyte * pc) 2996{ 2997 glConvolutionParameteri(*(GLenum *) (pc + 0), 2998 *(GLenum *) (pc + 4), *(GLint *) (pc + 8)); 2999} 3000 3001void 3002__glXDisp_ConvolutionParameteriv(GLbyte * pc) 3003{ 3004 const GLenum pname = *(GLenum *) (pc + 4); 3005 const GLint *params; 3006 3007 params = (const GLint *) (pc + 8); 3008 3009 glConvolutionParameteriv(*(GLenum *) (pc + 0), pname, params); 3010} 3011 3012void 3013__glXDisp_CopyConvolutionFilter1D(GLbyte * pc) 3014{ 3015 glCopyConvolutionFilter1D(*(GLenum *) (pc + 0), 3016 *(GLenum *) (pc + 4), 3017 *(GLint *) (pc + 8), 3018 *(GLint *) (pc + 12), *(GLsizei *) (pc + 16)); 3019} 3020 3021void 3022__glXDisp_CopyConvolutionFilter2D(GLbyte * pc) 3023{ 3024 glCopyConvolutionFilter2D(*(GLenum *) (pc + 0), 3025 *(GLenum *) (pc + 4), 3026 *(GLint *) (pc + 8), 3027 *(GLint *) (pc + 12), 3028 *(GLsizei *) (pc + 16), *(GLsizei *) (pc + 20)); 3029} 3030 3031int 3032__glXDisp_GetConvolutionParameterfv(__GLXclientState * cl, GLbyte * pc) 3033{ 3034 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3035 int error; 3036 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3037 3038 pc += __GLX_SINGLE_HDR_SIZE; 3039 if (cx != NULL) { 3040 const GLenum pname = *(GLenum *) (pc + 4); 3041 3042 const GLuint compsize = __glGetConvolutionParameterfv_size(pname); 3043 GLfloat answerBuffer[200]; 3044 GLfloat *params = 3045 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3046 sizeof(answerBuffer), 4); 3047 3048 if (params == NULL) 3049 return BadAlloc; 3050 __glXClearErrorOccured(); 3051 3052 glGetConvolutionParameterfv(*(GLenum *) (pc + 0), pname, params); 3053 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3054 error = Success; 3055 } 3056 3057 return error; 3058} 3059 3060int 3061__glXDisp_GetConvolutionParameterfvEXT(__GLXclientState * cl, GLbyte * pc) 3062{ 3063 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3064 int error; 3065 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3066 3067 pc += __GLX_VENDPRIV_HDR_SIZE; 3068 if (cx != NULL) { 3069 const GLenum pname = *(GLenum *) (pc + 4); 3070 3071 const GLuint compsize = __glGetConvolutionParameterfv_size(pname); 3072 GLfloat answerBuffer[200]; 3073 GLfloat *params = 3074 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3075 sizeof(answerBuffer), 4); 3076 3077 if (params == NULL) 3078 return BadAlloc; 3079 __glXClearErrorOccured(); 3080 3081 glGetConvolutionParameterfv(*(GLenum *) (pc + 0), pname, params); 3082 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3083 error = Success; 3084 } 3085 3086 return error; 3087} 3088 3089int 3090__glXDisp_GetConvolutionParameteriv(__GLXclientState * cl, GLbyte * pc) 3091{ 3092 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3093 int error; 3094 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3095 3096 pc += __GLX_SINGLE_HDR_SIZE; 3097 if (cx != NULL) { 3098 const GLenum pname = *(GLenum *) (pc + 4); 3099 3100 const GLuint compsize = __glGetConvolutionParameteriv_size(pname); 3101 GLint answerBuffer[200]; 3102 GLint *params = 3103 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3104 sizeof(answerBuffer), 4); 3105 3106 if (params == NULL) 3107 return BadAlloc; 3108 __glXClearErrorOccured(); 3109 3110 glGetConvolutionParameteriv(*(GLenum *) (pc + 0), pname, params); 3111 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3112 error = Success; 3113 } 3114 3115 return error; 3116} 3117 3118int 3119__glXDisp_GetConvolutionParameterivEXT(__GLXclientState * cl, GLbyte * pc) 3120{ 3121 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3122 int error; 3123 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3124 3125 pc += __GLX_VENDPRIV_HDR_SIZE; 3126 if (cx != NULL) { 3127 const GLenum pname = *(GLenum *) (pc + 4); 3128 3129 const GLuint compsize = __glGetConvolutionParameteriv_size(pname); 3130 GLint answerBuffer[200]; 3131 GLint *params = 3132 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3133 sizeof(answerBuffer), 4); 3134 3135 if (params == NULL) 3136 return BadAlloc; 3137 __glXClearErrorOccured(); 3138 3139 glGetConvolutionParameteriv(*(GLenum *) (pc + 0), pname, params); 3140 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3141 error = Success; 3142 } 3143 3144 return error; 3145} 3146 3147int 3148__glXDisp_GetHistogramParameterfv(__GLXclientState * cl, GLbyte * pc) 3149{ 3150 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3151 int error; 3152 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3153 3154 pc += __GLX_SINGLE_HDR_SIZE; 3155 if (cx != NULL) { 3156 const GLenum pname = *(GLenum *) (pc + 4); 3157 3158 const GLuint compsize = __glGetHistogramParameterfv_size(pname); 3159 GLfloat answerBuffer[200]; 3160 GLfloat *params = 3161 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3162 sizeof(answerBuffer), 4); 3163 3164 if (params == NULL) 3165 return BadAlloc; 3166 __glXClearErrorOccured(); 3167 3168 glGetHistogramParameterfv(*(GLenum *) (pc + 0), pname, params); 3169 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3170 error = Success; 3171 } 3172 3173 return error; 3174} 3175 3176int 3177__glXDisp_GetHistogramParameterfvEXT(__GLXclientState * cl, GLbyte * pc) 3178{ 3179 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3180 int error; 3181 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3182 3183 pc += __GLX_VENDPRIV_HDR_SIZE; 3184 if (cx != NULL) { 3185 const GLenum pname = *(GLenum *) (pc + 4); 3186 3187 const GLuint compsize = __glGetHistogramParameterfv_size(pname); 3188 GLfloat answerBuffer[200]; 3189 GLfloat *params = 3190 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3191 sizeof(answerBuffer), 4); 3192 3193 if (params == NULL) 3194 return BadAlloc; 3195 __glXClearErrorOccured(); 3196 3197 glGetHistogramParameterfv(*(GLenum *) (pc + 0), pname, params); 3198 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3199 error = Success; 3200 } 3201 3202 return error; 3203} 3204 3205int 3206__glXDisp_GetHistogramParameteriv(__GLXclientState * cl, GLbyte * pc) 3207{ 3208 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3209 int error; 3210 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3211 3212 pc += __GLX_SINGLE_HDR_SIZE; 3213 if (cx != NULL) { 3214 const GLenum pname = *(GLenum *) (pc + 4); 3215 3216 const GLuint compsize = __glGetHistogramParameteriv_size(pname); 3217 GLint answerBuffer[200]; 3218 GLint *params = 3219 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3220 sizeof(answerBuffer), 4); 3221 3222 if (params == NULL) 3223 return BadAlloc; 3224 __glXClearErrorOccured(); 3225 3226 glGetHistogramParameteriv(*(GLenum *) (pc + 0), pname, params); 3227 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3228 error = Success; 3229 } 3230 3231 return error; 3232} 3233 3234int 3235__glXDisp_GetHistogramParameterivEXT(__GLXclientState * cl, GLbyte * pc) 3236{ 3237 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3238 int error; 3239 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3240 3241 pc += __GLX_VENDPRIV_HDR_SIZE; 3242 if (cx != NULL) { 3243 const GLenum pname = *(GLenum *) (pc + 4); 3244 3245 const GLuint compsize = __glGetHistogramParameteriv_size(pname); 3246 GLint answerBuffer[200]; 3247 GLint *params = 3248 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3249 sizeof(answerBuffer), 4); 3250 3251 if (params == NULL) 3252 return BadAlloc; 3253 __glXClearErrorOccured(); 3254 3255 glGetHistogramParameteriv(*(GLenum *) (pc + 0), pname, params); 3256 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3257 error = Success; 3258 } 3259 3260 return error; 3261} 3262 3263int 3264__glXDisp_GetMinmaxParameterfv(__GLXclientState * cl, GLbyte * pc) 3265{ 3266 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3267 int error; 3268 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3269 3270 pc += __GLX_SINGLE_HDR_SIZE; 3271 if (cx != NULL) { 3272 const GLenum pname = *(GLenum *) (pc + 4); 3273 3274 const GLuint compsize = __glGetMinmaxParameterfv_size(pname); 3275 GLfloat answerBuffer[200]; 3276 GLfloat *params = 3277 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3278 sizeof(answerBuffer), 4); 3279 3280 if (params == NULL) 3281 return BadAlloc; 3282 __glXClearErrorOccured(); 3283 3284 glGetMinmaxParameterfv(*(GLenum *) (pc + 0), pname, params); 3285 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3286 error = Success; 3287 } 3288 3289 return error; 3290} 3291 3292int 3293__glXDisp_GetMinmaxParameterfvEXT(__GLXclientState * cl, GLbyte * pc) 3294{ 3295 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3296 int error; 3297 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3298 3299 pc += __GLX_VENDPRIV_HDR_SIZE; 3300 if (cx != NULL) { 3301 const GLenum pname = *(GLenum *) (pc + 4); 3302 3303 const GLuint compsize = __glGetMinmaxParameterfv_size(pname); 3304 GLfloat answerBuffer[200]; 3305 GLfloat *params = 3306 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3307 sizeof(answerBuffer), 4); 3308 3309 if (params == NULL) 3310 return BadAlloc; 3311 __glXClearErrorOccured(); 3312 3313 glGetMinmaxParameterfv(*(GLenum *) (pc + 0), pname, params); 3314 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3315 error = Success; 3316 } 3317 3318 return error; 3319} 3320 3321int 3322__glXDisp_GetMinmaxParameteriv(__GLXclientState * cl, GLbyte * pc) 3323{ 3324 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3325 int error; 3326 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3327 3328 pc += __GLX_SINGLE_HDR_SIZE; 3329 if (cx != NULL) { 3330 const GLenum pname = *(GLenum *) (pc + 4); 3331 3332 const GLuint compsize = __glGetMinmaxParameteriv_size(pname); 3333 GLint answerBuffer[200]; 3334 GLint *params = 3335 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3336 sizeof(answerBuffer), 4); 3337 3338 if (params == NULL) 3339 return BadAlloc; 3340 __glXClearErrorOccured(); 3341 3342 glGetMinmaxParameteriv(*(GLenum *) (pc + 0), pname, params); 3343 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3344 error = Success; 3345 } 3346 3347 return error; 3348} 3349 3350int 3351__glXDisp_GetMinmaxParameterivEXT(__GLXclientState * cl, GLbyte * pc) 3352{ 3353 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3354 int error; 3355 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3356 3357 pc += __GLX_VENDPRIV_HDR_SIZE; 3358 if (cx != NULL) { 3359 const GLenum pname = *(GLenum *) (pc + 4); 3360 3361 const GLuint compsize = __glGetMinmaxParameteriv_size(pname); 3362 GLint answerBuffer[200]; 3363 GLint *params = 3364 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3365 sizeof(answerBuffer), 4); 3366 3367 if (params == NULL) 3368 return BadAlloc; 3369 __glXClearErrorOccured(); 3370 3371 glGetMinmaxParameteriv(*(GLenum *) (pc + 0), pname, params); 3372 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3373 error = Success; 3374 } 3375 3376 return error; 3377} 3378 3379void 3380__glXDisp_Histogram(GLbyte * pc) 3381{ 3382 glHistogram(*(GLenum *) (pc + 0), 3383 *(GLsizei *) (pc + 4), 3384 *(GLenum *) (pc + 8), *(GLboolean *) (pc + 12)); 3385} 3386 3387void 3388__glXDisp_Minmax(GLbyte * pc) 3389{ 3390 glMinmax(*(GLenum *) (pc + 0), 3391 *(GLenum *) (pc + 4), *(GLboolean *) (pc + 8)); 3392} 3393 3394void 3395__glXDisp_ResetHistogram(GLbyte * pc) 3396{ 3397 glResetHistogram(*(GLenum *) (pc + 0)); 3398} 3399 3400void 3401__glXDisp_ResetMinmax(GLbyte * pc) 3402{ 3403 glResetMinmax(*(GLenum *) (pc + 0)); 3404} 3405 3406void 3407__glXDisp_TexImage3D(GLbyte * pc) 3408{ 3409 const CARD32 ptr_is_null = *(CARD32 *) (pc + 76); 3410 const GLvoid *const pixels = 3411 (const GLvoid *) ((ptr_is_null != 0) ? NULL : (pc + 80)); 3412 __GLXpixel3DHeader *const hdr = (__GLXpixel3DHeader *) (pc); 3413 3414 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 3415 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 3416 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 3417 glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, (GLint) hdr->imageHeight); 3418 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 3419 glPixelStorei(GL_UNPACK_SKIP_IMAGES, (GLint) hdr->skipImages); 3420 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 3421 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 3422 3423 glTexImage3D(*(GLenum *) (pc + 36), 3424 *(GLint *) (pc + 40), 3425 *(GLint *) (pc + 44), 3426 *(GLsizei *) (pc + 48), 3427 *(GLsizei *) (pc + 52), 3428 *(GLsizei *) (pc + 56), 3429 *(GLint *) (pc + 64), 3430 *(GLenum *) (pc + 68), *(GLenum *) (pc + 72), pixels); 3431} 3432 3433void 3434__glXDisp_TexSubImage3D(GLbyte * pc) 3435{ 3436 const GLvoid *const pixels = (const GLvoid *) ((pc + 88)); 3437 __GLXpixel3DHeader *const hdr = (__GLXpixel3DHeader *) (pc); 3438 3439 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 3440 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 3441 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); 3442 glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, (GLint) hdr->imageHeight); 3443 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); 3444 glPixelStorei(GL_UNPACK_SKIP_IMAGES, (GLint) hdr->skipImages); 3445 glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); 3446 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); 3447 3448 glTexSubImage3D(*(GLenum *) (pc + 36), 3449 *(GLint *) (pc + 40), 3450 *(GLint *) (pc + 44), 3451 *(GLint *) (pc + 48), 3452 *(GLint *) (pc + 52), 3453 *(GLsizei *) (pc + 60), 3454 *(GLsizei *) (pc + 64), 3455 *(GLsizei *) (pc + 68), 3456 *(GLenum *) (pc + 76), *(GLenum *) (pc + 80), pixels); 3457} 3458 3459void 3460__glXDisp_CopyTexSubImage3D(GLbyte * pc) 3461{ 3462 glCopyTexSubImage3D(*(GLenum *) (pc + 0), 3463 *(GLint *) (pc + 4), 3464 *(GLint *) (pc + 8), 3465 *(GLint *) (pc + 12), 3466 *(GLint *) (pc + 16), 3467 *(GLint *) (pc + 20), 3468 *(GLint *) (pc + 24), 3469 *(GLsizei *) (pc + 28), *(GLsizei *) (pc + 32)); 3470} 3471 3472void 3473__glXDisp_ActiveTexture(GLbyte * pc) 3474{ 3475 glActiveTextureARB(*(GLenum *) (pc + 0)); 3476} 3477 3478void 3479__glXDisp_MultiTexCoord1dv(GLbyte * pc) 3480{ 3481#ifdef __GLX_ALIGN64 3482 if ((unsigned long) (pc) & 7) { 3483 (void) memmove(pc - 4, pc, 12); 3484 pc -= 4; 3485 } 3486#endif 3487 3488 glMultiTexCoord1dvARB(*(GLenum *) (pc + 8), (const GLdouble *) (pc + 0)); 3489} 3490 3491void 3492__glXDisp_MultiTexCoord1fvARB(GLbyte * pc) 3493{ 3494 glMultiTexCoord1fvARB(*(GLenum *) (pc + 0), (const GLfloat *) (pc + 4)); 3495} 3496 3497void 3498__glXDisp_MultiTexCoord1iv(GLbyte * pc) 3499{ 3500 glMultiTexCoord1ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); 3501} 3502 3503void 3504__glXDisp_MultiTexCoord1sv(GLbyte * pc) 3505{ 3506 glMultiTexCoord1svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); 3507} 3508 3509void 3510__glXDisp_MultiTexCoord2dv(GLbyte * pc) 3511{ 3512#ifdef __GLX_ALIGN64 3513 if ((unsigned long) (pc) & 7) { 3514 (void) memmove(pc - 4, pc, 20); 3515 pc -= 4; 3516 } 3517#endif 3518 3519 glMultiTexCoord2dvARB(*(GLenum *) (pc + 16), (const GLdouble *) (pc + 0)); 3520} 3521 3522void 3523__glXDisp_MultiTexCoord2fvARB(GLbyte * pc) 3524{ 3525 glMultiTexCoord2fvARB(*(GLenum *) (pc + 0), (const GLfloat *) (pc + 4)); 3526} 3527 3528void 3529__glXDisp_MultiTexCoord2iv(GLbyte * pc) 3530{ 3531 glMultiTexCoord2ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); 3532} 3533 3534void 3535__glXDisp_MultiTexCoord2sv(GLbyte * pc) 3536{ 3537 glMultiTexCoord2svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); 3538} 3539 3540void 3541__glXDisp_MultiTexCoord3dv(GLbyte * pc) 3542{ 3543#ifdef __GLX_ALIGN64 3544 if ((unsigned long) (pc) & 7) { 3545 (void) memmove(pc - 4, pc, 28); 3546 pc -= 4; 3547 } 3548#endif 3549 3550 glMultiTexCoord3dvARB(*(GLenum *) (pc + 24), (const GLdouble *) (pc + 0)); 3551} 3552 3553void 3554__glXDisp_MultiTexCoord3fvARB(GLbyte * pc) 3555{ 3556 glMultiTexCoord3fvARB(*(GLenum *) (pc + 0), (const GLfloat *) (pc + 4)); 3557} 3558 3559void 3560__glXDisp_MultiTexCoord3iv(GLbyte * pc) 3561{ 3562 glMultiTexCoord3ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); 3563} 3564 3565void 3566__glXDisp_MultiTexCoord3sv(GLbyte * pc) 3567{ 3568 glMultiTexCoord3svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); 3569} 3570 3571void 3572__glXDisp_MultiTexCoord4dv(GLbyte * pc) 3573{ 3574#ifdef __GLX_ALIGN64 3575 if ((unsigned long) (pc) & 7) { 3576 (void) memmove(pc - 4, pc, 36); 3577 pc -= 4; 3578 } 3579#endif 3580 3581 glMultiTexCoord4dvARB(*(GLenum *) (pc + 32), (const GLdouble *) (pc + 0)); 3582} 3583 3584void 3585__glXDisp_MultiTexCoord4fvARB(GLbyte * pc) 3586{ 3587 glMultiTexCoord4fvARB(*(GLenum *) (pc + 0), (const GLfloat *) (pc + 4)); 3588} 3589 3590void 3591__glXDisp_MultiTexCoord4iv(GLbyte * pc) 3592{ 3593 glMultiTexCoord4ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); 3594} 3595 3596void 3597__glXDisp_MultiTexCoord4sv(GLbyte * pc) 3598{ 3599 glMultiTexCoord4svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); 3600} 3601 3602void 3603__glXDisp_CompressedTexImage1D(GLbyte * pc) 3604{ 3605 PFNGLCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D = 3606 __glGetProcAddress("glCompressedTexImage1D"); 3607 const GLsizei imageSize = *(GLsizei *) (pc + 20); 3608 3609 CompressedTexImage1D(*(GLenum *) (pc + 0), 3610 *(GLint *) (pc + 4), 3611 *(GLenum *) (pc + 8), 3612 *(GLsizei *) (pc + 12), 3613 *(GLint *) (pc + 16), 3614 imageSize, (const GLvoid *) (pc + 24)); 3615} 3616 3617void 3618__glXDisp_CompressedTexImage2D(GLbyte * pc) 3619{ 3620 PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D = 3621 __glGetProcAddress("glCompressedTexImage2D"); 3622 const GLsizei imageSize = *(GLsizei *) (pc + 24); 3623 3624 CompressedTexImage2D(*(GLenum *) (pc + 0), 3625 *(GLint *) (pc + 4), 3626 *(GLenum *) (pc + 8), 3627 *(GLsizei *) (pc + 12), 3628 *(GLsizei *) (pc + 16), 3629 *(GLint *) (pc + 20), 3630 imageSize, (const GLvoid *) (pc + 28)); 3631} 3632 3633void 3634__glXDisp_CompressedTexImage3D(GLbyte * pc) 3635{ 3636 PFNGLCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D = 3637 __glGetProcAddress("glCompressedTexImage3D"); 3638 const GLsizei imageSize = *(GLsizei *) (pc + 28); 3639 3640 CompressedTexImage3D(*(GLenum *) (pc + 0), 3641 *(GLint *) (pc + 4), 3642 *(GLenum *) (pc + 8), 3643 *(GLsizei *) (pc + 12), 3644 *(GLsizei *) (pc + 16), 3645 *(GLsizei *) (pc + 20), 3646 *(GLint *) (pc + 24), 3647 imageSize, (const GLvoid *) (pc + 32)); 3648} 3649 3650void 3651__glXDisp_CompressedTexSubImage1D(GLbyte * pc) 3652{ 3653 PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D = 3654 __glGetProcAddress("glCompressedTexSubImage1D"); 3655 const GLsizei imageSize = *(GLsizei *) (pc + 20); 3656 3657 CompressedTexSubImage1D(*(GLenum *) (pc + 0), 3658 *(GLint *) (pc + 4), 3659 *(GLint *) (pc + 8), 3660 *(GLsizei *) (pc + 12), 3661 *(GLenum *) (pc + 16), 3662 imageSize, (const GLvoid *) (pc + 24)); 3663} 3664 3665void 3666__glXDisp_CompressedTexSubImage2D(GLbyte * pc) 3667{ 3668 PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D = 3669 __glGetProcAddress("glCompressedTexSubImage2D"); 3670 const GLsizei imageSize = *(GLsizei *) (pc + 28); 3671 3672 CompressedTexSubImage2D(*(GLenum *) (pc + 0), 3673 *(GLint *) (pc + 4), 3674 *(GLint *) (pc + 8), 3675 *(GLint *) (pc + 12), 3676 *(GLsizei *) (pc + 16), 3677 *(GLsizei *) (pc + 20), 3678 *(GLenum *) (pc + 24), 3679 imageSize, (const GLvoid *) (pc + 32)); 3680} 3681 3682void 3683__glXDisp_CompressedTexSubImage3D(GLbyte * pc) 3684{ 3685 PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D = 3686 __glGetProcAddress("glCompressedTexSubImage3D"); 3687 const GLsizei imageSize = *(GLsizei *) (pc + 36); 3688 3689 CompressedTexSubImage3D(*(GLenum *) (pc + 0), 3690 *(GLint *) (pc + 4), 3691 *(GLint *) (pc + 8), 3692 *(GLint *) (pc + 12), 3693 *(GLint *) (pc + 16), 3694 *(GLsizei *) (pc + 20), 3695 *(GLsizei *) (pc + 24), 3696 *(GLsizei *) (pc + 28), 3697 *(GLenum *) (pc + 32), 3698 imageSize, (const GLvoid *) (pc + 40)); 3699} 3700 3701void 3702__glXDisp_SampleCoverage(GLbyte * pc) 3703{ 3704 PFNGLSAMPLECOVERAGEPROC SampleCoverage = 3705 __glGetProcAddress("glSampleCoverage"); 3706 SampleCoverage(*(GLclampf *) (pc + 0), *(GLboolean *) (pc + 4)); 3707} 3708 3709void 3710__glXDisp_BlendFuncSeparate(GLbyte * pc) 3711{ 3712 PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate = 3713 __glGetProcAddress("glBlendFuncSeparate"); 3714 BlendFuncSeparate(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), 3715 *(GLenum *) (pc + 8), *(GLenum *) (pc + 12)); 3716} 3717 3718void 3719__glXDisp_FogCoorddv(GLbyte * pc) 3720{ 3721 PFNGLFOGCOORDDVPROC FogCoorddv = __glGetProcAddress("glFogCoorddv"); 3722 3723#ifdef __GLX_ALIGN64 3724 if ((unsigned long) (pc) & 7) { 3725 (void) memmove(pc - 4, pc, 8); 3726 pc -= 4; 3727 } 3728#endif 3729 3730 FogCoorddv((const GLdouble *) (pc + 0)); 3731} 3732 3733void 3734__glXDisp_PointParameterf(GLbyte * pc) 3735{ 3736 PFNGLPOINTPARAMETERFPROC PointParameterf = 3737 __glGetProcAddress("glPointParameterf"); 3738 PointParameterf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); 3739} 3740 3741void 3742__glXDisp_PointParameterfv(GLbyte * pc) 3743{ 3744 PFNGLPOINTPARAMETERFVPROC PointParameterfv = 3745 __glGetProcAddress("glPointParameterfv"); 3746 const GLenum pname = *(GLenum *) (pc + 0); 3747 const GLfloat *params; 3748 3749 params = (const GLfloat *) (pc + 4); 3750 3751 PointParameterfv(pname, params); 3752} 3753 3754void 3755__glXDisp_PointParameteri(GLbyte * pc) 3756{ 3757 PFNGLPOINTPARAMETERIPROC PointParameteri = 3758 __glGetProcAddress("glPointParameteri"); 3759 PointParameteri(*(GLenum *) (pc + 0), *(GLint *) (pc + 4)); 3760} 3761 3762void 3763__glXDisp_PointParameteriv(GLbyte * pc) 3764{ 3765 PFNGLPOINTPARAMETERIVPROC PointParameteriv = 3766 __glGetProcAddress("glPointParameteriv"); 3767 const GLenum pname = *(GLenum *) (pc + 0); 3768 const GLint *params; 3769 3770 params = (const GLint *) (pc + 4); 3771 3772 PointParameteriv(pname, params); 3773} 3774 3775void 3776__glXDisp_SecondaryColor3bv(GLbyte * pc) 3777{ 3778 PFNGLSECONDARYCOLOR3BVPROC SecondaryColor3bv = 3779 __glGetProcAddress("glSecondaryColor3bv"); 3780 SecondaryColor3bv((const GLbyte *) (pc + 0)); 3781} 3782 3783void 3784__glXDisp_SecondaryColor3dv(GLbyte * pc) 3785{ 3786 PFNGLSECONDARYCOLOR3DVPROC SecondaryColor3dv = 3787 __glGetProcAddress("glSecondaryColor3dv"); 3788#ifdef __GLX_ALIGN64 3789 if ((unsigned long) (pc) & 7) { 3790 (void) memmove(pc - 4, pc, 24); 3791 pc -= 4; 3792 } 3793#endif 3794 3795 SecondaryColor3dv((const GLdouble *) (pc + 0)); 3796} 3797 3798void 3799__glXDisp_SecondaryColor3iv(GLbyte * pc) 3800{ 3801 PFNGLSECONDARYCOLOR3IVPROC SecondaryColor3iv = 3802 __glGetProcAddress("glSecondaryColor3iv"); 3803 SecondaryColor3iv((const GLint *) (pc + 0)); 3804} 3805 3806void 3807__glXDisp_SecondaryColor3sv(GLbyte * pc) 3808{ 3809 PFNGLSECONDARYCOLOR3SVPROC SecondaryColor3sv = 3810 __glGetProcAddress("glSecondaryColor3sv"); 3811 SecondaryColor3sv((const GLshort *) (pc + 0)); 3812} 3813 3814void 3815__glXDisp_SecondaryColor3ubv(GLbyte * pc) 3816{ 3817 PFNGLSECONDARYCOLOR3UBVPROC SecondaryColor3ubv = 3818 __glGetProcAddress("glSecondaryColor3ubv"); 3819 SecondaryColor3ubv((const GLubyte *) (pc + 0)); 3820} 3821 3822void 3823__glXDisp_SecondaryColor3uiv(GLbyte * pc) 3824{ 3825 PFNGLSECONDARYCOLOR3UIVPROC SecondaryColor3uiv = 3826 __glGetProcAddress("glSecondaryColor3uiv"); 3827 SecondaryColor3uiv((const GLuint *) (pc + 0)); 3828} 3829 3830void 3831__glXDisp_SecondaryColor3usv(GLbyte * pc) 3832{ 3833 PFNGLSECONDARYCOLOR3USVPROC SecondaryColor3usv = 3834 __glGetProcAddress("glSecondaryColor3usv"); 3835 SecondaryColor3usv((const GLushort *) (pc + 0)); 3836} 3837 3838void 3839__glXDisp_WindowPos3fv(GLbyte * pc) 3840{ 3841 PFNGLWINDOWPOS3FVPROC WindowPos3fv = __glGetProcAddress("glWindowPos3fv"); 3842 3843 WindowPos3fv((const GLfloat *) (pc + 0)); 3844} 3845 3846void 3847__glXDisp_BeginQuery(GLbyte * pc) 3848{ 3849 PFNGLBEGINQUERYPROC BeginQuery = __glGetProcAddress("glBeginQuery"); 3850 3851 BeginQuery(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); 3852} 3853 3854int 3855__glXDisp_DeleteQueries(__GLXclientState * cl, GLbyte * pc) 3856{ 3857 PFNGLDELETEQUERIESPROC DeleteQueries = 3858 __glGetProcAddress("glDeleteQueries"); 3859 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3860 int error; 3861 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3862 3863 pc += __GLX_SINGLE_HDR_SIZE; 3864 if (cx != NULL) { 3865 const GLsizei n = *(GLsizei *) (pc + 0); 3866 3867 DeleteQueries(n, (const GLuint *) (pc + 4)); 3868 error = Success; 3869 } 3870 3871 return error; 3872} 3873 3874void 3875__glXDisp_EndQuery(GLbyte * pc) 3876{ 3877 PFNGLENDQUERYPROC EndQuery = __glGetProcAddress("glEndQuery"); 3878 3879 EndQuery(*(GLenum *) (pc + 0)); 3880} 3881 3882int 3883__glXDisp_GenQueries(__GLXclientState * cl, GLbyte * pc) 3884{ 3885 PFNGLGENQUERIESPROC GenQueries = __glGetProcAddress("glGenQueries"); 3886 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3887 int error; 3888 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3889 3890 pc += __GLX_SINGLE_HDR_SIZE; 3891 if (cx != NULL) { 3892 const GLsizei n = *(GLsizei *) (pc + 0); 3893 3894 GLuint answerBuffer[200]; 3895 GLuint *ids = 3896 __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 3897 4); 3898 3899 if (ids == NULL) 3900 return BadAlloc; 3901 GenQueries(n, ids); 3902 __glXSendReply(cl->client, ids, n, 4, GL_TRUE, 0); 3903 error = Success; 3904 } 3905 3906 return error; 3907} 3908 3909int 3910__glXDisp_GetQueryObjectiv(__GLXclientState * cl, GLbyte * pc) 3911{ 3912 PFNGLGETQUERYOBJECTIVPROC GetQueryObjectiv = 3913 __glGetProcAddress("glGetQueryObjectiv"); 3914 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3915 int error; 3916 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3917 3918 pc += __GLX_SINGLE_HDR_SIZE; 3919 if (cx != NULL) { 3920 const GLenum pname = *(GLenum *) (pc + 4); 3921 3922 const GLuint compsize = __glGetQueryObjectiv_size(pname); 3923 GLint answerBuffer[200]; 3924 GLint *params = 3925 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3926 sizeof(answerBuffer), 4); 3927 3928 if (params == NULL) 3929 return BadAlloc; 3930 __glXClearErrorOccured(); 3931 3932 GetQueryObjectiv(*(GLuint *) (pc + 0), pname, params); 3933 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3934 error = Success; 3935 } 3936 3937 return error; 3938} 3939 3940int 3941__glXDisp_GetQueryObjectuiv(__GLXclientState * cl, GLbyte * pc) 3942{ 3943 PFNGLGETQUERYOBJECTUIVPROC GetQueryObjectuiv = 3944 __glGetProcAddress("glGetQueryObjectuiv"); 3945 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3946 int error; 3947 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3948 3949 pc += __GLX_SINGLE_HDR_SIZE; 3950 if (cx != NULL) { 3951 const GLenum pname = *(GLenum *) (pc + 4); 3952 3953 const GLuint compsize = __glGetQueryObjectuiv_size(pname); 3954 GLuint answerBuffer[200]; 3955 GLuint *params = 3956 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3957 sizeof(answerBuffer), 4); 3958 3959 if (params == NULL) 3960 return BadAlloc; 3961 __glXClearErrorOccured(); 3962 3963 GetQueryObjectuiv(*(GLuint *) (pc + 0), pname, params); 3964 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3965 error = Success; 3966 } 3967 3968 return error; 3969} 3970 3971int 3972__glXDisp_GetQueryiv(__GLXclientState * cl, GLbyte * pc) 3973{ 3974 PFNGLGETQUERYIVPROC GetQueryiv = __glGetProcAddress("glGetQueryiv"); 3975 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3976 int error; 3977 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 3978 3979 pc += __GLX_SINGLE_HDR_SIZE; 3980 if (cx != NULL) { 3981 const GLenum pname = *(GLenum *) (pc + 4); 3982 3983 const GLuint compsize = __glGetQueryiv_size(pname); 3984 GLint answerBuffer[200]; 3985 GLint *params = 3986 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3987 sizeof(answerBuffer), 4); 3988 3989 if (params == NULL) 3990 return BadAlloc; 3991 __glXClearErrorOccured(); 3992 3993 GetQueryiv(*(GLenum *) (pc + 0), pname, params); 3994 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 3995 error = Success; 3996 } 3997 3998 return error; 3999} 4000 4001int 4002__glXDisp_IsQuery(__GLXclientState * cl, GLbyte * pc) 4003{ 4004 PFNGLISQUERYPROC IsQuery = __glGetProcAddress("glIsQuery"); 4005 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 4006 int error; 4007 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4008 4009 pc += __GLX_SINGLE_HDR_SIZE; 4010 if (cx != NULL) { 4011 GLboolean retval; 4012 4013 retval = IsQuery(*(GLuint *) (pc + 0)); 4014 __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 4015 error = Success; 4016 } 4017 4018 return error; 4019} 4020 4021void 4022__glXDisp_BlendEquationSeparate(GLbyte * pc) 4023{ 4024 PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate = 4025 __glGetProcAddress("glBlendEquationSeparate"); 4026 BlendEquationSeparate(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); 4027} 4028 4029void 4030__glXDisp_DrawBuffers(GLbyte * pc) 4031{ 4032 PFNGLDRAWBUFFERSPROC DrawBuffers = __glGetProcAddress("glDrawBuffers"); 4033 const GLsizei n = *(GLsizei *) (pc + 0); 4034 4035 DrawBuffers(n, (const GLenum *) (pc + 4)); 4036} 4037 4038void 4039__glXDisp_VertexAttrib1dv(GLbyte * pc) 4040{ 4041 PFNGLVERTEXATTRIB1DVPROC VertexAttrib1dv = 4042 __glGetProcAddress("glVertexAttrib1dv"); 4043#ifdef __GLX_ALIGN64 4044 if ((unsigned long) (pc) & 7) { 4045 (void) memmove(pc - 4, pc, 12); 4046 pc -= 4; 4047 } 4048#endif 4049 4050 VertexAttrib1dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); 4051} 4052 4053void 4054__glXDisp_VertexAttrib1sv(GLbyte * pc) 4055{ 4056 PFNGLVERTEXATTRIB1SVPROC VertexAttrib1sv = 4057 __glGetProcAddress("glVertexAttrib1sv"); 4058 VertexAttrib1sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); 4059} 4060 4061void 4062__glXDisp_VertexAttrib2dv(GLbyte * pc) 4063{ 4064 PFNGLVERTEXATTRIB2DVPROC VertexAttrib2dv = 4065 __glGetProcAddress("glVertexAttrib2dv"); 4066#ifdef __GLX_ALIGN64 4067 if ((unsigned long) (pc) & 7) { 4068 (void) memmove(pc - 4, pc, 20); 4069 pc -= 4; 4070 } 4071#endif 4072 4073 VertexAttrib2dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); 4074} 4075 4076void 4077__glXDisp_VertexAttrib2sv(GLbyte * pc) 4078{ 4079 PFNGLVERTEXATTRIB2SVPROC VertexAttrib2sv = 4080 __glGetProcAddress("glVertexAttrib2sv"); 4081 VertexAttrib2sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); 4082} 4083 4084void 4085__glXDisp_VertexAttrib3dv(GLbyte * pc) 4086{ 4087 PFNGLVERTEXATTRIB3DVPROC VertexAttrib3dv = 4088 __glGetProcAddress("glVertexAttrib3dv"); 4089#ifdef __GLX_ALIGN64 4090 if ((unsigned long) (pc) & 7) { 4091 (void) memmove(pc - 4, pc, 28); 4092 pc -= 4; 4093 } 4094#endif 4095 4096 VertexAttrib3dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); 4097} 4098 4099void 4100__glXDisp_VertexAttrib3sv(GLbyte * pc) 4101{ 4102 PFNGLVERTEXATTRIB3SVPROC VertexAttrib3sv = 4103 __glGetProcAddress("glVertexAttrib3sv"); 4104 VertexAttrib3sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); 4105} 4106 4107void 4108__glXDisp_VertexAttrib4Nbv(GLbyte * pc) 4109{ 4110 PFNGLVERTEXATTRIB4NBVPROC VertexAttrib4Nbv = 4111 __glGetProcAddress("glVertexAttrib4Nbv"); 4112 VertexAttrib4Nbv(*(GLuint *) (pc + 0), (const GLbyte *) (pc + 4)); 4113} 4114 4115void 4116__glXDisp_VertexAttrib4Niv(GLbyte * pc) 4117{ 4118 PFNGLVERTEXATTRIB4NIVPROC VertexAttrib4Niv = 4119 __glGetProcAddress("glVertexAttrib4Niv"); 4120 VertexAttrib4Niv(*(GLuint *) (pc + 0), (const GLint *) (pc + 4)); 4121} 4122 4123void 4124__glXDisp_VertexAttrib4Nsv(GLbyte * pc) 4125{ 4126 PFNGLVERTEXATTRIB4NSVPROC VertexAttrib4Nsv = 4127 __glGetProcAddress("glVertexAttrib4Nsv"); 4128 VertexAttrib4Nsv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); 4129} 4130 4131void 4132__glXDisp_VertexAttrib4Nubv(GLbyte * pc) 4133{ 4134 PFNGLVERTEXATTRIB4NUBVPROC VertexAttrib4Nubv = 4135 __glGetProcAddress("glVertexAttrib4Nubv"); 4136 VertexAttrib4Nubv(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4)); 4137} 4138 4139void 4140__glXDisp_VertexAttrib4Nuiv(GLbyte * pc) 4141{ 4142 PFNGLVERTEXATTRIB4NUIVPROC VertexAttrib4Nuiv = 4143 __glGetProcAddress("glVertexAttrib4Nuiv"); 4144 VertexAttrib4Nuiv(*(GLuint *) (pc + 0), (const GLuint *) (pc + 4)); 4145} 4146 4147void 4148__glXDisp_VertexAttrib4Nusv(GLbyte * pc) 4149{ 4150 PFNGLVERTEXATTRIB4NUSVPROC VertexAttrib4Nusv = 4151 __glGetProcAddress("glVertexAttrib4Nusv"); 4152 VertexAttrib4Nusv(*(GLuint *) (pc + 0), (const GLushort *) (pc + 4)); 4153} 4154 4155void 4156__glXDisp_VertexAttrib4bv(GLbyte * pc) 4157{ 4158 PFNGLVERTEXATTRIB4BVPROC VertexAttrib4bv = 4159 __glGetProcAddress("glVertexAttrib4bv"); 4160 VertexAttrib4bv(*(GLuint *) (pc + 0), (const GLbyte *) (pc + 4)); 4161} 4162 4163void 4164__glXDisp_VertexAttrib4dv(GLbyte * pc) 4165{ 4166 PFNGLVERTEXATTRIB4DVPROC VertexAttrib4dv = 4167 __glGetProcAddress("glVertexAttrib4dv"); 4168#ifdef __GLX_ALIGN64 4169 if ((unsigned long) (pc) & 7) { 4170 (void) memmove(pc - 4, pc, 36); 4171 pc -= 4; 4172 } 4173#endif 4174 4175 VertexAttrib4dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); 4176} 4177 4178void 4179__glXDisp_VertexAttrib4iv(GLbyte * pc) 4180{ 4181 PFNGLVERTEXATTRIB4IVPROC VertexAttrib4iv = 4182 __glGetProcAddress("glVertexAttrib4iv"); 4183 VertexAttrib4iv(*(GLuint *) (pc + 0), (const GLint *) (pc + 4)); 4184} 4185 4186void 4187__glXDisp_VertexAttrib4sv(GLbyte * pc) 4188{ 4189 PFNGLVERTEXATTRIB4SVPROC VertexAttrib4sv = 4190 __glGetProcAddress("glVertexAttrib4sv"); 4191 VertexAttrib4sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); 4192} 4193 4194void 4195__glXDisp_VertexAttrib4ubv(GLbyte * pc) 4196{ 4197 PFNGLVERTEXATTRIB4UBVPROC VertexAttrib4ubv = 4198 __glGetProcAddress("glVertexAttrib4ubv"); 4199 VertexAttrib4ubv(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4)); 4200} 4201 4202void 4203__glXDisp_VertexAttrib4uiv(GLbyte * pc) 4204{ 4205 PFNGLVERTEXATTRIB4UIVPROC VertexAttrib4uiv = 4206 __glGetProcAddress("glVertexAttrib4uiv"); 4207 VertexAttrib4uiv(*(GLuint *) (pc + 0), (const GLuint *) (pc + 4)); 4208} 4209 4210void 4211__glXDisp_VertexAttrib4usv(GLbyte * pc) 4212{ 4213 PFNGLVERTEXATTRIB4USVPROC VertexAttrib4usv = 4214 __glGetProcAddress("glVertexAttrib4usv"); 4215 VertexAttrib4usv(*(GLuint *) (pc + 0), (const GLushort *) (pc + 4)); 4216} 4217 4218void 4219__glXDisp_ClampColor(GLbyte * pc) 4220{ 4221 PFNGLCLAMPCOLORPROC ClampColor = __glGetProcAddress("glClampColor"); 4222 4223 ClampColor(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); 4224} 4225 4226void 4227__glXDisp_BindProgramARB(GLbyte * pc) 4228{ 4229 PFNGLBINDPROGRAMARBPROC BindProgramARB = 4230 __glGetProcAddress("glBindProgramARB"); 4231 BindProgramARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); 4232} 4233 4234int 4235__glXDisp_DeleteProgramsARB(__GLXclientState * cl, GLbyte * pc) 4236{ 4237 PFNGLDELETEPROGRAMSARBPROC DeleteProgramsARB = 4238 __glGetProcAddress("glDeleteProgramsARB"); 4239 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4240 int error; 4241 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4242 4243 pc += __GLX_VENDPRIV_HDR_SIZE; 4244 if (cx != NULL) { 4245 const GLsizei n = *(GLsizei *) (pc + 0); 4246 4247 DeleteProgramsARB(n, (const GLuint *) (pc + 4)); 4248 error = Success; 4249 } 4250 4251 return error; 4252} 4253 4254int 4255__glXDisp_GenProgramsARB(__GLXclientState * cl, GLbyte * pc) 4256{ 4257 PFNGLGENPROGRAMSARBPROC GenProgramsARB = 4258 __glGetProcAddress("glGenProgramsARB"); 4259 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4260 int error; 4261 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4262 4263 pc += __GLX_VENDPRIV_HDR_SIZE; 4264 if (cx != NULL) { 4265 const GLsizei n = *(GLsizei *) (pc + 0); 4266 4267 GLuint answerBuffer[200]; 4268 GLuint *programs = 4269 __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4270 4); 4271 4272 if (programs == NULL) 4273 return BadAlloc; 4274 GenProgramsARB(n, programs); 4275 __glXSendReply(cl->client, programs, n, 4, GL_TRUE, 0); 4276 error = Success; 4277 } 4278 4279 return error; 4280} 4281 4282int 4283__glXDisp_GetProgramEnvParameterdvARB(__GLXclientState * cl, GLbyte * pc) 4284{ 4285 PFNGLGETPROGRAMENVPARAMETERDVARBPROC GetProgramEnvParameterdvARB = 4286 __glGetProcAddress("glGetProgramEnvParameterdvARB"); 4287 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4288 int error; 4289 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4290 4291 pc += __GLX_VENDPRIV_HDR_SIZE; 4292 if (cx != NULL) { 4293 GLdouble params[4]; 4294 4295 GetProgramEnvParameterdvARB(*(GLenum *) (pc + 0), 4296 *(GLuint *) (pc + 4), params); 4297 __glXSendReply(cl->client, params, 4, 8, GL_FALSE, 0); 4298 error = Success; 4299 } 4300 4301 return error; 4302} 4303 4304int 4305__glXDisp_GetProgramEnvParameterfvARB(__GLXclientState * cl, GLbyte * pc) 4306{ 4307 PFNGLGETPROGRAMENVPARAMETERFVARBPROC GetProgramEnvParameterfvARB = 4308 __glGetProcAddress("glGetProgramEnvParameterfvARB"); 4309 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4310 int error; 4311 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4312 4313 pc += __GLX_VENDPRIV_HDR_SIZE; 4314 if (cx != NULL) { 4315 GLfloat params[4]; 4316 4317 GetProgramEnvParameterfvARB(*(GLenum *) (pc + 0), 4318 *(GLuint *) (pc + 4), params); 4319 __glXSendReply(cl->client, params, 4, 4, GL_FALSE, 0); 4320 error = Success; 4321 } 4322 4323 return error; 4324} 4325 4326int 4327__glXDisp_GetProgramLocalParameterdvARB(__GLXclientState * cl, GLbyte * pc) 4328{ 4329 PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC GetProgramLocalParameterdvARB = 4330 __glGetProcAddress("glGetProgramLocalParameterdvARB"); 4331 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4332 int error; 4333 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4334 4335 pc += __GLX_VENDPRIV_HDR_SIZE; 4336 if (cx != NULL) { 4337 GLdouble params[4]; 4338 4339 GetProgramLocalParameterdvARB(*(GLenum *) (pc + 0), 4340 *(GLuint *) (pc + 4), params); 4341 __glXSendReply(cl->client, params, 4, 8, GL_FALSE, 0); 4342 error = Success; 4343 } 4344 4345 return error; 4346} 4347 4348int 4349__glXDisp_GetProgramLocalParameterfvARB(__GLXclientState * cl, GLbyte * pc) 4350{ 4351 PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC GetProgramLocalParameterfvARB = 4352 __glGetProcAddress("glGetProgramLocalParameterfvARB"); 4353 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4354 int error; 4355 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4356 4357 pc += __GLX_VENDPRIV_HDR_SIZE; 4358 if (cx != NULL) { 4359 GLfloat params[4]; 4360 4361 GetProgramLocalParameterfvARB(*(GLenum *) (pc + 0), 4362 *(GLuint *) (pc + 4), params); 4363 __glXSendReply(cl->client, params, 4, 4, GL_FALSE, 0); 4364 error = Success; 4365 } 4366 4367 return error; 4368} 4369 4370int 4371__glXDisp_GetProgramivARB(__GLXclientState * cl, GLbyte * pc) 4372{ 4373 PFNGLGETPROGRAMIVARBPROC GetProgramivARB = 4374 __glGetProcAddress("glGetProgramivARB"); 4375 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4376 int error; 4377 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4378 4379 pc += __GLX_VENDPRIV_HDR_SIZE; 4380 if (cx != NULL) { 4381 const GLenum pname = *(GLenum *) (pc + 4); 4382 4383 const GLuint compsize = __glGetProgramivARB_size(pname); 4384 GLint answerBuffer[200]; 4385 GLint *params = 4386 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 4387 sizeof(answerBuffer), 4); 4388 4389 if (params == NULL) 4390 return BadAlloc; 4391 __glXClearErrorOccured(); 4392 4393 GetProgramivARB(*(GLenum *) (pc + 0), pname, params); 4394 __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); 4395 error = Success; 4396 } 4397 4398 return error; 4399} 4400 4401int 4402__glXDisp_IsProgramARB(__GLXclientState * cl, GLbyte * pc) 4403{ 4404 PFNGLISPROGRAMARBPROC IsProgramARB = __glGetProcAddress("glIsProgramARB"); 4405 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4406 int error; 4407 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4408 4409 pc += __GLX_VENDPRIV_HDR_SIZE; 4410 if (cx != NULL) { 4411 GLboolean retval; 4412 4413 retval = IsProgramARB(*(GLuint *) (pc + 0)); 4414 __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 4415 error = Success; 4416 } 4417 4418 return error; 4419} 4420 4421void 4422__glXDisp_ProgramEnvParameter4dvARB(GLbyte * pc) 4423{ 4424 PFNGLPROGRAMENVPARAMETER4DVARBPROC ProgramEnvParameter4dvARB = 4425 __glGetProcAddress("glProgramEnvParameter4dvARB"); 4426#ifdef __GLX_ALIGN64 4427 if ((unsigned long) (pc) & 7) { 4428 (void) memmove(pc - 4, pc, 40); 4429 pc -= 4; 4430 } 4431#endif 4432 4433 ProgramEnvParameter4dvARB(*(GLenum *) (pc + 0), 4434 *(GLuint *) (pc + 4), 4435 (const GLdouble *) (pc + 8)); 4436} 4437 4438void 4439__glXDisp_ProgramEnvParameter4fvARB(GLbyte * pc) 4440{ 4441 PFNGLPROGRAMENVPARAMETER4FVARBPROC ProgramEnvParameter4fvARB = 4442 __glGetProcAddress("glProgramEnvParameter4fvARB"); 4443 ProgramEnvParameter4fvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4), 4444 (const GLfloat *) (pc + 8)); 4445} 4446 4447void 4448__glXDisp_ProgramLocalParameter4dvARB(GLbyte * pc) 4449{ 4450 PFNGLPROGRAMLOCALPARAMETER4DVARBPROC ProgramLocalParameter4dvARB = 4451 __glGetProcAddress("glProgramLocalParameter4dvARB"); 4452#ifdef __GLX_ALIGN64 4453 if ((unsigned long) (pc) & 7) { 4454 (void) memmove(pc - 4, pc, 40); 4455 pc -= 4; 4456 } 4457#endif 4458 4459 ProgramLocalParameter4dvARB(*(GLenum *) (pc + 0), 4460 *(GLuint *) (pc + 4), 4461 (const GLdouble *) (pc + 8)); 4462} 4463 4464void 4465__glXDisp_ProgramLocalParameter4fvARB(GLbyte * pc) 4466{ 4467 PFNGLPROGRAMLOCALPARAMETER4FVARBPROC ProgramLocalParameter4fvARB = 4468 __glGetProcAddress("glProgramLocalParameter4fvARB"); 4469 ProgramLocalParameter4fvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4), 4470 (const GLfloat *) (pc + 8)); 4471} 4472 4473void 4474__glXDisp_ProgramStringARB(GLbyte * pc) 4475{ 4476 PFNGLPROGRAMSTRINGARBPROC ProgramStringARB = 4477 __glGetProcAddress("glProgramStringARB"); 4478 const GLsizei len = *(GLsizei *) (pc + 8); 4479 4480 ProgramStringARB(*(GLenum *) (pc + 0), 4481 *(GLenum *) (pc + 4), len, (const GLvoid *) (pc + 12)); 4482} 4483 4484void 4485__glXDisp_VertexAttrib1fvARB(GLbyte * pc) 4486{ 4487 PFNGLVERTEXATTRIB1FVARBPROC VertexAttrib1fvARB = 4488 __glGetProcAddress("glVertexAttrib1fvARB"); 4489 VertexAttrib1fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); 4490} 4491 4492void 4493__glXDisp_VertexAttrib2fvARB(GLbyte * pc) 4494{ 4495 PFNGLVERTEXATTRIB2FVARBPROC VertexAttrib2fvARB = 4496 __glGetProcAddress("glVertexAttrib2fvARB"); 4497 VertexAttrib2fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); 4498} 4499 4500void 4501__glXDisp_VertexAttrib3fvARB(GLbyte * pc) 4502{ 4503 PFNGLVERTEXATTRIB3FVARBPROC VertexAttrib3fvARB = 4504 __glGetProcAddress("glVertexAttrib3fvARB"); 4505 VertexAttrib3fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); 4506} 4507 4508void 4509__glXDisp_VertexAttrib4fvARB(GLbyte * pc) 4510{ 4511 PFNGLVERTEXATTRIB4FVARBPROC VertexAttrib4fvARB = 4512 __glGetProcAddress("glVertexAttrib4fvARB"); 4513 VertexAttrib4fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); 4514} 4515 4516void 4517__glXDisp_BindFramebuffer(GLbyte * pc) 4518{ 4519 PFNGLBINDFRAMEBUFFERPROC BindFramebuffer = 4520 __glGetProcAddress("glBindFramebuffer"); 4521 BindFramebuffer(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); 4522} 4523 4524void 4525__glXDisp_BindRenderbuffer(GLbyte * pc) 4526{ 4527 PFNGLBINDRENDERBUFFERPROC BindRenderbuffer = 4528 __glGetProcAddress("glBindRenderbuffer"); 4529 BindRenderbuffer(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); 4530} 4531 4532void 4533__glXDisp_BlitFramebuffer(GLbyte * pc) 4534{ 4535 PFNGLBLITFRAMEBUFFERPROC BlitFramebuffer = 4536 __glGetProcAddress("glBlitFramebuffer"); 4537 BlitFramebuffer(*(GLint *) (pc + 0), *(GLint *) (pc + 4), 4538 *(GLint *) (pc + 8), *(GLint *) (pc + 12), 4539 *(GLint *) (pc + 16), *(GLint *) (pc + 20), 4540 *(GLint *) (pc + 24), *(GLint *) (pc + 28), 4541 *(GLbitfield *) (pc + 32), *(GLenum *) (pc + 36)); 4542} 4543 4544int 4545__glXDisp_CheckFramebufferStatus(__GLXclientState * cl, GLbyte * pc) 4546{ 4547 PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus = 4548 __glGetProcAddress("glCheckFramebufferStatus"); 4549 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4550 int error; 4551 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4552 4553 pc += __GLX_VENDPRIV_HDR_SIZE; 4554 if (cx != NULL) { 4555 GLenum retval; 4556 4557 retval = CheckFramebufferStatus(*(GLenum *) (pc + 0)); 4558 __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 4559 error = Success; 4560 } 4561 4562 return error; 4563} 4564 4565void 4566__glXDisp_DeleteFramebuffers(GLbyte * pc) 4567{ 4568 PFNGLDELETEFRAMEBUFFERSPROC DeleteFramebuffers = 4569 __glGetProcAddress("glDeleteFramebuffers"); 4570 const GLsizei n = *(GLsizei *) (pc + 0); 4571 4572 DeleteFramebuffers(n, (const GLuint *) (pc + 4)); 4573} 4574 4575void 4576__glXDisp_DeleteRenderbuffers(GLbyte * pc) 4577{ 4578 PFNGLDELETERENDERBUFFERSPROC DeleteRenderbuffers = 4579 __glGetProcAddress("glDeleteRenderbuffers"); 4580 const GLsizei n = *(GLsizei *) (pc + 0); 4581 4582 DeleteRenderbuffers(n, (const GLuint *) (pc + 4)); 4583} 4584 4585void 4586__glXDisp_FramebufferRenderbuffer(GLbyte * pc) 4587{ 4588 PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer = 4589 __glGetProcAddress("glFramebufferRenderbuffer"); 4590 FramebufferRenderbuffer(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), 4591 *(GLenum *) (pc + 8), *(GLuint *) (pc + 12)); 4592} 4593 4594void 4595__glXDisp_FramebufferTexture1D(GLbyte * pc) 4596{ 4597 PFNGLFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D = 4598 __glGetProcAddress("glFramebufferTexture1D"); 4599 FramebufferTexture1D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), 4600 *(GLenum *) (pc + 8), *(GLuint *) (pc + 12), 4601 *(GLint *) (pc + 16)); 4602} 4603 4604void 4605__glXDisp_FramebufferTexture2D(GLbyte * pc) 4606{ 4607 PFNGLFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D = 4608 __glGetProcAddress("glFramebufferTexture2D"); 4609 FramebufferTexture2D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), 4610 *(GLenum *) (pc + 8), *(GLuint *) (pc + 12), 4611 *(GLint *) (pc + 16)); 4612} 4613 4614void 4615__glXDisp_FramebufferTexture3D(GLbyte * pc) 4616{ 4617 PFNGLFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D = 4618 __glGetProcAddress("glFramebufferTexture3D"); 4619 FramebufferTexture3D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), 4620 *(GLenum *) (pc + 8), *(GLuint *) (pc + 12), 4621 *(GLint *) (pc + 16), *(GLint *) (pc + 20)); 4622} 4623 4624void 4625__glXDisp_FramebufferTextureLayer(GLbyte * pc) 4626{ 4627 PFNGLFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer = 4628 __glGetProcAddress("glFramebufferTextureLayer"); 4629 FramebufferTextureLayer(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), 4630 *(GLuint *) (pc + 8), *(GLint *) (pc + 12), 4631 *(GLint *) (pc + 16)); 4632} 4633 4634int 4635__glXDisp_GenFramebuffers(__GLXclientState * cl, GLbyte * pc) 4636{ 4637 PFNGLGENFRAMEBUFFERSPROC GenFramebuffers = 4638 __glGetProcAddress("glGenFramebuffers"); 4639 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4640 int error; 4641 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4642 4643 pc += __GLX_VENDPRIV_HDR_SIZE; 4644 if (cx != NULL) { 4645 const GLsizei n = *(GLsizei *) (pc + 0); 4646 4647 GLuint answerBuffer[200]; 4648 GLuint *framebuffers = 4649 __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4650 4); 4651 4652 if (framebuffers == NULL) 4653 return BadAlloc; 4654 4655 GenFramebuffers(n, framebuffers); 4656 __glXSendReply(cl->client, framebuffers, n, 4, GL_TRUE, 0); 4657 error = Success; 4658 } 4659 4660 return error; 4661} 4662 4663int 4664__glXDisp_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc) 4665{ 4666 PFNGLGENRENDERBUFFERSPROC GenRenderbuffers = 4667 __glGetProcAddress("glGenRenderbuffers"); 4668 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4669 int error; 4670 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4671 4672 pc += __GLX_VENDPRIV_HDR_SIZE; 4673 if (cx != NULL) { 4674 const GLsizei n = *(GLsizei *) (pc + 0); 4675 4676 GLuint answerBuffer[200]; 4677 GLuint *renderbuffers = 4678 __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4679 4); 4680 4681 if (renderbuffers == NULL) 4682 return BadAlloc; 4683 GenRenderbuffers(n, renderbuffers); 4684 __glXSendReply(cl->client, renderbuffers, n, 4, GL_TRUE, 0); 4685 error = Success; 4686 } 4687 4688 return error; 4689} 4690 4691void 4692__glXDisp_GenerateMipmap(GLbyte * pc) 4693{ 4694 PFNGLGENERATEMIPMAPPROC GenerateMipmap = 4695 __glGetProcAddress("glGenerateMipmap"); 4696 GenerateMipmap(*(GLenum *) (pc + 0)); 4697} 4698 4699int 4700__glXDisp_GetFramebufferAttachmentParameteriv(__GLXclientState * cl, 4701 GLbyte * pc) 4702{ 4703 PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC 4704 GetFramebufferAttachmentParameteriv = 4705 __glGetProcAddress("glGetFramebufferAttachmentParameteriv"); 4706 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4707 int error; 4708 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4709 4710 pc += __GLX_VENDPRIV_HDR_SIZE; 4711 if (cx != NULL) { 4712 GLint params[1]; 4713 4714 GetFramebufferAttachmentParameteriv(*(GLenum *) (pc + 0), 4715 *(GLenum *) (pc + 4), 4716 *(GLenum *) (pc + 8), params); 4717 __glXSendReply(cl->client, params, 1, 4, GL_FALSE, 0); 4718 error = Success; 4719 } 4720 4721 return error; 4722} 4723 4724int 4725__glXDisp_GetRenderbufferParameteriv(__GLXclientState * cl, GLbyte * pc) 4726{ 4727 PFNGLGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv = 4728 __glGetProcAddress("glGetRenderbufferParameteriv"); 4729 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4730 int error; 4731 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4732 4733 pc += __GLX_VENDPRIV_HDR_SIZE; 4734 if (cx != NULL) { 4735 GLint params[1]; 4736 4737 GetRenderbufferParameteriv(*(GLenum *) (pc + 0), 4738 *(GLenum *) (pc + 4), params); 4739 __glXSendReply(cl->client, params, 1, 4, GL_FALSE, 0); 4740 error = Success; 4741 } 4742 4743 return error; 4744} 4745 4746int 4747__glXDisp_IsFramebuffer(__GLXclientState * cl, GLbyte * pc) 4748{ 4749 PFNGLISFRAMEBUFFERPROC IsFramebuffer = 4750 __glGetProcAddress("glIsFramebuffer"); 4751 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4752 int error; 4753 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4754 4755 pc += __GLX_VENDPRIV_HDR_SIZE; 4756 if (cx != NULL) { 4757 GLboolean retval; 4758 4759 retval = IsFramebuffer(*(GLuint *) (pc + 0)); 4760 __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 4761 error = Success; 4762 } 4763 4764 return error; 4765} 4766 4767int 4768__glXDisp_IsRenderbuffer(__GLXclientState * cl, GLbyte * pc) 4769{ 4770 PFNGLISRENDERBUFFERPROC IsRenderbuffer = 4771 __glGetProcAddress("glIsRenderbuffer"); 4772 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4773 int error; 4774 __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); 4775 4776 pc += __GLX_VENDPRIV_HDR_SIZE; 4777 if (cx != NULL) { 4778 GLboolean retval; 4779 4780 retval = IsRenderbuffer(*(GLuint *) (pc + 0)); 4781 __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 4782 error = Success; 4783 } 4784 4785 return error; 4786} 4787 4788void 4789__glXDisp_RenderbufferStorage(GLbyte * pc) 4790{ 4791 PFNGLRENDERBUFFERSTORAGEPROC RenderbufferStorage = 4792 __glGetProcAddress("glRenderbufferStorage"); 4793 RenderbufferStorage(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), 4794 *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12)); 4795} 4796 4797void 4798__glXDisp_RenderbufferStorageMultisample(GLbyte * pc) 4799{ 4800 PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample = 4801 __glGetProcAddress("glRenderbufferStorageMultisample"); 4802 RenderbufferStorageMultisample(*(GLenum *) (pc + 0), *(GLsizei *) (pc + 4), 4803 *(GLenum *) (pc + 8), *(GLsizei *) (pc + 12), 4804 *(GLsizei *) (pc + 16)); 4805} 4806 4807void 4808__glXDisp_SecondaryColor3fvEXT(GLbyte * pc) 4809{ 4810 PFNGLSECONDARYCOLOR3FVEXTPROC SecondaryColor3fvEXT = 4811 __glGetProcAddress("glSecondaryColor3fvEXT"); 4812 SecondaryColor3fvEXT((const GLfloat *) (pc + 0)); 4813} 4814 4815void 4816__glXDisp_FogCoordfvEXT(GLbyte * pc) 4817{ 4818 PFNGLFOGCOORDFVEXTPROC FogCoordfvEXT = 4819 __glGetProcAddress("glFogCoordfvEXT"); 4820 FogCoordfvEXT((const GLfloat *) (pc + 0)); 4821} 4822 4823void 4824__glXDisp_VertexAttrib1dvNV(GLbyte * pc) 4825{ 4826 PFNGLVERTEXATTRIB1DVNVPROC VertexAttrib1dvNV = 4827 __glGetProcAddress("glVertexAttrib1dvNV"); 4828#ifdef __GLX_ALIGN64 4829 if ((unsigned long) (pc) & 7) { 4830 (void) memmove(pc - 4, pc, 12); 4831 pc -= 4; 4832 } 4833#endif 4834 4835 VertexAttrib1dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); 4836} 4837 4838void 4839__glXDisp_VertexAttrib1fvNV(GLbyte * pc) 4840{ 4841 PFNGLVERTEXATTRIB1FVNVPROC VertexAttrib1fvNV = 4842 __glGetProcAddress("glVertexAttrib1fvNV"); 4843 VertexAttrib1fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); 4844} 4845 4846void 4847__glXDisp_VertexAttrib1svNV(GLbyte * pc) 4848{ 4849 PFNGLVERTEXATTRIB1SVNVPROC VertexAttrib1svNV = 4850 __glGetProcAddress("glVertexAttrib1svNV"); 4851 VertexAttrib1svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); 4852} 4853 4854void 4855__glXDisp_VertexAttrib2dvNV(GLbyte * pc) 4856{ 4857 PFNGLVERTEXATTRIB2DVNVPROC VertexAttrib2dvNV = 4858 __glGetProcAddress("glVertexAttrib2dvNV"); 4859#ifdef __GLX_ALIGN64 4860 if ((unsigned long) (pc) & 7) { 4861 (void) memmove(pc - 4, pc, 20); 4862 pc -= 4; 4863 } 4864#endif 4865 4866 VertexAttrib2dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); 4867} 4868 4869void 4870__glXDisp_VertexAttrib2fvNV(GLbyte * pc) 4871{ 4872 PFNGLVERTEXATTRIB2FVNVPROC VertexAttrib2fvNV = 4873 __glGetProcAddress("glVertexAttrib2fvNV"); 4874 VertexAttrib2fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); 4875} 4876 4877void 4878__glXDisp_VertexAttrib2svNV(GLbyte * pc) 4879{ 4880 PFNGLVERTEXATTRIB2SVNVPROC VertexAttrib2svNV = 4881 __glGetProcAddress("glVertexAttrib2svNV"); 4882 VertexAttrib2svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); 4883} 4884 4885void 4886__glXDisp_VertexAttrib3dvNV(GLbyte * pc) 4887{ 4888 PFNGLVERTEXATTRIB3DVNVPROC VertexAttrib3dvNV = 4889 __glGetProcAddress("glVertexAttrib3dvNV"); 4890#ifdef __GLX_ALIGN64 4891 if ((unsigned long) (pc) & 7) { 4892 (void) memmove(pc - 4, pc, 28); 4893 pc -= 4; 4894 } 4895#endif 4896 4897 VertexAttrib3dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); 4898} 4899 4900void 4901__glXDisp_VertexAttrib3fvNV(GLbyte * pc) 4902{ 4903 PFNGLVERTEXATTRIB3FVNVPROC VertexAttrib3fvNV = 4904 __glGetProcAddress("glVertexAttrib3fvNV"); 4905 VertexAttrib3fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); 4906} 4907 4908void 4909__glXDisp_VertexAttrib3svNV(GLbyte * pc) 4910{ 4911 PFNGLVERTEXATTRIB3SVNVPROC VertexAttrib3svNV = 4912 __glGetProcAddress("glVertexAttrib3svNV"); 4913 VertexAttrib3svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); 4914} 4915 4916void 4917__glXDisp_VertexAttrib4dvNV(GLbyte * pc) 4918{ 4919 PFNGLVERTEXATTRIB4DVNVPROC VertexAttrib4dvNV = 4920 __glGetProcAddress("glVertexAttrib4dvNV"); 4921#ifdef __GLX_ALIGN64 4922 if ((unsigned long) (pc) & 7) { 4923 (void) memmove(pc - 4, pc, 36); 4924 pc -= 4; 4925 } 4926#endif 4927 4928 VertexAttrib4dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); 4929} 4930 4931void 4932__glXDisp_VertexAttrib4fvNV(GLbyte * pc) 4933{ 4934 PFNGLVERTEXATTRIB4FVNVPROC VertexAttrib4fvNV = 4935 __glGetProcAddress("glVertexAttrib4fvNV"); 4936 VertexAttrib4fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); 4937} 4938 4939void 4940__glXDisp_VertexAttrib4svNV(GLbyte * pc) 4941{ 4942 PFNGLVERTEXATTRIB4SVNVPROC VertexAttrib4svNV = 4943 __glGetProcAddress("glVertexAttrib4svNV"); 4944 VertexAttrib4svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); 4945} 4946 4947void 4948__glXDisp_VertexAttrib4ubvNV(GLbyte * pc) 4949{ 4950 PFNGLVERTEXATTRIB4UBVNVPROC VertexAttrib4ubvNV = 4951 __glGetProcAddress("glVertexAttrib4ubvNV"); 4952 VertexAttrib4ubvNV(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4)); 4953} 4954 4955void 4956__glXDisp_VertexAttribs1dvNV(GLbyte * pc) 4957{ 4958 PFNGLVERTEXATTRIBS1DVNVPROC VertexAttribs1dvNV = 4959 __glGetProcAddress("glVertexAttribs1dvNV"); 4960 const GLsizei n = *(GLsizei *) (pc + 4); 4961 4962#ifdef __GLX_ALIGN64 4963 const GLuint cmdlen = 12 + __GLX_PAD((n * 8)) - 4; 4964 4965 if ((unsigned long) (pc) & 7) { 4966 (void) memmove(pc - 4, pc, cmdlen); 4967 pc -= 4; 4968 } 4969#endif 4970 4971 VertexAttribs1dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); 4972} 4973 4974void 4975__glXDisp_VertexAttribs1fvNV(GLbyte * pc) 4976{ 4977 PFNGLVERTEXATTRIBS1FVNVPROC VertexAttribs1fvNV = 4978 __glGetProcAddress("glVertexAttribs1fvNV"); 4979 const GLsizei n = *(GLsizei *) (pc + 4); 4980 4981 VertexAttribs1fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); 4982} 4983 4984void 4985__glXDisp_VertexAttribs1svNV(GLbyte * pc) 4986{ 4987 PFNGLVERTEXATTRIBS1SVNVPROC VertexAttribs1svNV = 4988 __glGetProcAddress("glVertexAttribs1svNV"); 4989 const GLsizei n = *(GLsizei *) (pc + 4); 4990 4991 VertexAttribs1svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); 4992} 4993 4994void 4995__glXDisp_VertexAttribs2dvNV(GLbyte * pc) 4996{ 4997 PFNGLVERTEXATTRIBS2DVNVPROC VertexAttribs2dvNV = 4998 __glGetProcAddress("glVertexAttribs2dvNV"); 4999 const GLsizei n = *(GLsizei *) (pc + 4); 5000 5001#ifdef __GLX_ALIGN64 5002 const GLuint cmdlen = 12 + __GLX_PAD((n * 16)) - 4; 5003 5004 if ((unsigned long) (pc) & 7) { 5005 (void) memmove(pc - 4, pc, cmdlen); 5006 pc -= 4; 5007 } 5008#endif 5009 5010 VertexAttribs2dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); 5011} 5012 5013void 5014__glXDisp_VertexAttribs2fvNV(GLbyte * pc) 5015{ 5016 PFNGLVERTEXATTRIBS2FVNVPROC VertexAttribs2fvNV = 5017 __glGetProcAddress("glVertexAttribs2fvNV"); 5018 const GLsizei n = *(GLsizei *) (pc + 4); 5019 5020 VertexAttribs2fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); 5021} 5022 5023void 5024__glXDisp_VertexAttribs2svNV(GLbyte * pc) 5025{ 5026 PFNGLVERTEXATTRIBS2SVNVPROC VertexAttribs2svNV = 5027 __glGetProcAddress("glVertexAttribs2svNV"); 5028 const GLsizei n = *(GLsizei *) (pc + 4); 5029 5030 VertexAttribs2svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); 5031} 5032 5033void 5034__glXDisp_VertexAttribs3dvNV(GLbyte * pc) 5035{ 5036 PFNGLVERTEXATTRIBS3DVNVPROC VertexAttribs3dvNV = 5037 __glGetProcAddress("glVertexAttribs3dvNV"); 5038 const GLsizei n = *(GLsizei *) (pc + 4); 5039 5040#ifdef __GLX_ALIGN64 5041 const GLuint cmdlen = 12 + __GLX_PAD((n * 24)) - 4; 5042 5043 if ((unsigned long) (pc) & 7) { 5044 (void) memmove(pc - 4, pc, cmdlen); 5045 pc -= 4; 5046 } 5047#endif 5048 5049 VertexAttribs3dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); 5050} 5051 5052void 5053__glXDisp_VertexAttribs3fvNV(GLbyte * pc) 5054{ 5055 PFNGLVERTEXATTRIBS3FVNVPROC VertexAttribs3fvNV = 5056 __glGetProcAddress("glVertexAttribs3fvNV"); 5057 const GLsizei n = *(GLsizei *) (pc + 4); 5058 5059 VertexAttribs3fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); 5060} 5061 5062void 5063__glXDisp_VertexAttribs3svNV(GLbyte * pc) 5064{ 5065 PFNGLVERTEXATTRIBS3SVNVPROC VertexAttribs3svNV = 5066 __glGetProcAddress("glVertexAttribs3svNV"); 5067 const GLsizei n = *(GLsizei *) (pc + 4); 5068 5069 VertexAttribs3svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); 5070} 5071 5072void 5073__glXDisp_VertexAttribs4dvNV(GLbyte * pc) 5074{ 5075 PFNGLVERTEXATTRIBS4DVNVPROC VertexAttribs4dvNV = 5076 __glGetProcAddress("glVertexAttribs4dvNV"); 5077 const GLsizei n = *(GLsizei *) (pc + 4); 5078 5079#ifdef __GLX_ALIGN64 5080 const GLuint cmdlen = 12 + __GLX_PAD((n * 32)) - 4; 5081 5082 if ((unsigned long) (pc) & 7) { 5083 (void) memmove(pc - 4, pc, cmdlen); 5084 pc -= 4; 5085 } 5086#endif 5087 5088 VertexAttribs4dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); 5089} 5090 5091void 5092__glXDisp_VertexAttribs4fvNV(GLbyte * pc) 5093{ 5094 PFNGLVERTEXATTRIBS4FVNVPROC VertexAttribs4fvNV = 5095 __glGetProcAddress("glVertexAttribs4fvNV"); 5096 const GLsizei n = *(GLsizei *) (pc + 4); 5097 5098 VertexAttribs4fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); 5099} 5100 5101void 5102__glXDisp_VertexAttribs4svNV(GLbyte * pc) 5103{ 5104 PFNGLVERTEXATTRIBS4SVNVPROC VertexAttribs4svNV = 5105 __glGetProcAddress("glVertexAttribs4svNV"); 5106 const GLsizei n = *(GLsizei *) (pc + 4); 5107 5108 VertexAttribs4svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); 5109} 5110 5111void 5112__glXDisp_VertexAttribs4ubvNV(GLbyte * pc) 5113{ 5114 PFNGLVERTEXATTRIBS4UBVNVPROC VertexAttribs4ubvNV = 5115 __glGetProcAddress("glVertexAttribs4ubvNV"); 5116 const GLsizei n = *(GLsizei *) (pc + 4); 5117 5118 VertexAttribs4ubvNV(*(GLuint *) (pc + 0), n, (const GLubyte *) (pc + 8)); 5119} 5120 5121void 5122__glXDisp_ActiveStencilFaceEXT(GLbyte * pc) 5123{ 5124 PFNGLACTIVESTENCILFACEEXTPROC ActiveStencilFaceEXT = 5125 __glGetProcAddress("glActiveStencilFaceEXT"); 5126 ActiveStencilFaceEXT(*(GLenum *) (pc + 0)); 5127} 5128