1 /* 2 * Mesa 3-D graphics library 3 * Version: 2.5 4 * Copyright (C) 1995-1997 Brian Paul 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the Free 18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 */ 20 21 #ifdef PC_HEADER 22 #include "all.h" 23 #else 24 #include <stdio.h> 25 #include <stdlib.h> 26 #include "api.h" 27 #include "bitmap.h" 28 #include "context.h" 29 30 #include "drawpix.h" 31 32 #include "eval.h" 33 #include "image.h" 34 #include "macros.h" 35 #include "matrix.h" 36 #include "teximage.h" 37 #include "types.h" 38 #include "vb.h" 39 #endif 40 41 void APIENTRY _mesa_Accum( GLenum op, GLfloat value ) 42 { 43 GET_CONTEXT; 44 (*CC->API.Accum)(CC, op, value); 45 } 46 47 void APIENTRY _mesa_AlphaFunc( GLenum func, GLclampf ref ) 48 { 49 GET_CONTEXT; 50 (*CC->API.AlphaFunc)(CC, func, ref); 51 } 52 53 54 GLboolean APIENTRY _mesa_AreTexturesResident( GLsizei n, const GLuint *textures, 55 GLboolean *residences ) 56 { 57 GET_CONTEXT; 58 return (*CC->API.AreTexturesResident)(CC, n, textures, residences); 59 } 60 61 void APIENTRY _mesa_ArrayElement( GLint i ) 62 { 63 GET_CONTEXT; 64 (*CC->API.ArrayElement)(CC, i); 65 } 66 67 68 void APIENTRY _mesa_Begin( GLenum mode ) 69 { 70 GET_CONTEXT; 71 (*CC->API.Begin)( CC, mode ); 72 } 73 74 75 void APIENTRY _mesa_BindTexture( GLenum target, GLuint texture ) 76 { 77 GET_CONTEXT; 78 (*CC->API.BindTexture)(CC, target, texture); 79 } 80 81 82 void APIENTRY _mesa_Bitmap( GLsizei width, GLsizei height, 83 GLfloat xorig, GLfloat yorig, 84 GLfloat xmove, GLfloat ymove, 85 const GLubyte *bitmap ) 86 { 87 GET_CONTEXT; 88 if (!CC->CompileFlag) { 89 /* execute only, try optimized case where no unpacking needed */ 90 if ( CC->Unpack.LsbFirst==GL_FALSE 91 && CC->Unpack.Alignment==1 92 && CC->Unpack.RowLength==0 93 && CC->Unpack.SkipPixels==0 94 && CC->Unpack.SkipRows==0) { 95 /* Special case: no unpacking needed */ 96 struct gl_image image; 97 image.Width = width; 98 image.Height = height; 99 image.Components = 0; 100 image.Type = GL_BITMAP; 101 image.Format = GL_COLOR_INDEX; 102 image.Data = (GLvoid *) bitmap; 103 (*CC->Exec.Bitmap)( CC, width, height, xorig, yorig, 104 xmove, ymove, &image ); 105 } 106 else { 107 struct gl_image *image; 108 image = gl_unpack_bitmap( CC, width, height, bitmap ); 109 (*CC->Exec.Bitmap)( CC, width, height, xorig, yorig, 110 xmove, ymove, image ); 111 if (image) { 112 gl_free_image( image ); 113 } 114 } 115 } 116 else { 117 /* compile and maybe execute */ 118 struct gl_image *image; 119 image = gl_unpack_bitmap( CC, width, height, bitmap ); 120 (*CC->API.Bitmap)(CC, width, height, xorig, yorig, xmove, ymove, image ); 121 } 122 } 123 124 125 void APIENTRY _mesa_BlendFunc( GLenum sfactor, GLenum dfactor ) 126 { 127 GET_CONTEXT; 128 (*CC->API.BlendFunc)(CC, sfactor, dfactor); 129 } 130 131 132 void APIENTRY _mesa_CallList( GLuint list ) 133 { 134 GET_CONTEXT; 135 (*CC->API.CallList)(CC, list); 136 } 137 138 139 void APIENTRY _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ) 140 { 141 GET_CONTEXT; 142 (*CC->API.CallLists)(CC, n, type, lists); 143 } 144 145 146 void APIENTRY _mesa_Clear( GLbitfield mask ) 147 { 148 GET_CONTEXT; 149 (*CC->API.Clear)(CC, mask); 150 } 151 152 153 void APIENTRY _mesa_ClearAccum( GLfloat red, GLfloat green, 154 GLfloat blue, GLfloat alpha ) 155 { 156 GET_CONTEXT; 157 (*CC->API.ClearAccum)(CC, red, green, blue, alpha); 158 } 159 160 161 162 void APIENTRY _mesa_ClearIndex( GLfloat c ) 163 { 164 GET_CONTEXT; 165 (*CC->API.ClearIndex)(CC, c); 166 } 167 168 169 void APIENTRY _mesa_ClearColor( GLclampf red, 170 GLclampf green, 171 GLclampf blue, 172 GLclampf alpha ) 173 { 174 GET_CONTEXT; 175 (*CC->API.ClearColor)(CC, red, green, blue, alpha); 176 } 177 178 179 void APIENTRY _mesa_ClearDepth( GLclampd depth ) 180 { 181 GET_CONTEXT; 182 (*CC->API.ClearDepth)( CC, depth ); 183 } 184 185 186 void APIENTRY _mesa_ClearStencil( GLint s ) 187 { 188 GET_CONTEXT; 189 (*CC->API.ClearStencil)(CC, s); 190 } 191 192 193 void APIENTRY _mesa_ClipPlane( GLenum plane, const GLdouble *equation ) 194 { 195 GLfloat eq[4]; 196 GET_CONTEXT; 197 eq[0] = (GLfloat) equation[0]; 198 eq[1] = (GLfloat) equation[1]; 199 eq[2] = (GLfloat) equation[2]; 200 eq[3] = (GLfloat) equation[3]; 201 (*CC->API.ClipPlane)(CC, plane, eq ); 202 } 203 204 205 void APIENTRY _mesa_Color3b( GLbyte red, GLbyte green, GLbyte blue ) 206 { 207 GET_CONTEXT; 208 (*CC->API.Color3f)( CC, BYTE_TO_FLOAT(red), BYTE_TO_FLOAT(green), 209 BYTE_TO_FLOAT(blue) ); 210 } 211 212 213 void APIENTRY _mesa_Color3d( GLdouble red, GLdouble green, GLdouble blue ) 214 { 215 GET_CONTEXT; 216 (*CC->API.Color3f)( CC, (GLfloat) red, (GLfloat) green, (GLfloat) blue ); 217 } 218 219 220 void APIENTRY _mesa_Color3f( GLfloat red, GLfloat green, GLfloat blue ) 221 { 222 GET_CONTEXT; 223 (*CC->API.Color3f)( CC, red, green, blue ); 224 } 225 226 227 void APIENTRY _mesa_Color3i( GLint red, GLint green, GLint blue ) 228 { 229 GET_CONTEXT; 230 (*CC->API.Color3f)( CC, INT_TO_FLOAT(red), INT_TO_FLOAT(green), 231 INT_TO_FLOAT(blue) ); 232 } 233 234 235 void APIENTRY _mesa_Color3s( GLshort red, GLshort green, GLshort blue ) 236 { 237 GET_CONTEXT; 238 (*CC->API.Color3f)( CC, SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green), 239 SHORT_TO_FLOAT(blue) ); 240 } 241 242 243 void APIENTRY _mesa_Color3ub( GLubyte red, GLubyte green, GLubyte blue ) 244 { 245 GET_CONTEXT; 246 (*CC->API.Color4ub)( CC, red, green, blue, 255 ); 247 } 248 249 250 void APIENTRY _mesa_Color3ui( GLuint red, GLuint green, GLuint blue ) 251 { 252 GET_CONTEXT; 253 (*CC->API.Color3f)( CC, UINT_TO_FLOAT(red), UINT_TO_FLOAT(green), 254 UINT_TO_FLOAT(blue) ); 255 } 256 257 258 void APIENTRY _mesa_Color3us( GLushort red, GLushort green, GLushort blue ) 259 { 260 GET_CONTEXT; 261 (*CC->API.Color3f)( CC, USHORT_TO_FLOAT(red), USHORT_TO_FLOAT(green), 262 USHORT_TO_FLOAT(blue) ); 263 } 264 265 266 void APIENTRY _mesa_Color4b( GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha ) 267 { 268 GET_CONTEXT; 269 (*CC->API.Color4f)( CC, BYTE_TO_FLOAT(red), BYTE_TO_FLOAT(green), 270 BYTE_TO_FLOAT(blue), BYTE_TO_FLOAT(alpha) ); 271 } 272 273 274 void APIENTRY _mesa_Color4d( GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha ) 275 { 276 GET_CONTEXT; 277 (*CC->API.Color4f)( CC, (GLfloat) red, (GLfloat) green, 278 (GLfloat) blue, (GLfloat) alpha ); 279 } 280 281 282 void APIENTRY _mesa_Color4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) 283 { 284 GET_CONTEXT; 285 (*CC->API.Color4f)( CC, red, green, blue, alpha ); 286 } 287 288 void APIENTRY _mesa_Color4i( GLint red, GLint green, GLint blue, GLint alpha ) 289 { 290 GET_CONTEXT; 291 (*CC->API.Color4f)( CC, INT_TO_FLOAT(red), INT_TO_FLOAT(green), 292 INT_TO_FLOAT(blue), INT_TO_FLOAT(alpha) ); 293 } 294 295 296 void APIENTRY _mesa_Color4s( GLshort red, GLshort green, GLshort blue, GLshort alpha ) 297 { 298 GET_CONTEXT; 299 (*CC->API.Color4f)( CC, SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green), 300 SHORT_TO_FLOAT(blue), SHORT_TO_FLOAT(alpha) ); 301 } 302 303 void APIENTRY _mesa_Color4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) 304 { 305 GET_CONTEXT; 306 (*CC->API.Color4ub)( CC, red, green, blue, alpha ); 307 } 308 309 void APIENTRY _mesa_Color4ui( GLuint red, GLuint green, GLuint blue, GLuint alpha ) 310 { 311 GET_CONTEXT; 312 (*CC->API.Color4f)( CC, UINT_TO_FLOAT(red), UINT_TO_FLOAT(green), 313 UINT_TO_FLOAT(blue), UINT_TO_FLOAT(alpha) ); 314 } 315 316 void APIENTRY _mesa_Color4us( GLushort red, GLushort green, GLushort blue, GLushort alpha ) 317 { 318 GET_CONTEXT; 319 (*CC->API.Color4f)( CC, USHORT_TO_FLOAT(red), USHORT_TO_FLOAT(green), 320 USHORT_TO_FLOAT(blue), USHORT_TO_FLOAT(alpha) ); 321 } 322 323 324 void APIENTRY _mesa_Color3bv( const GLbyte *v ) 325 { 326 GET_CONTEXT; 327 (*CC->API.Color3f)( CC, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), 328 BYTE_TO_FLOAT(v[2]) ); 329 } 330 331 332 void APIENTRY _mesa_Color3dv( const GLdouble *v ) 333 { 334 GET_CONTEXT; 335 (*CC->API.Color3f)( CC, (GLdouble) v[0], (GLdouble) v[1], (GLdouble) v[2] ); 336 } 337 338 339 void APIENTRY _mesa_Color3fv( const GLfloat *v ) 340 { 341 GET_CONTEXT; 342 (*CC->API.Color3fv)( CC, v ); 343 } 344 345 346 void APIENTRY _mesa_Color3iv( const GLint *v ) 347 { 348 GET_CONTEXT; 349 (*CC->API.Color3f)( CC, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), 350 INT_TO_FLOAT(v[2]) ); 351 } 352 353 354 void APIENTRY _mesa_Color3sv( const GLshort *v ) 355 { 356 GET_CONTEXT; 357 (*CC->API.Color3f)( CC, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), 358 SHORT_TO_FLOAT(v[2]) ); 359 } 360 361 362 void APIENTRY _mesa_Color3ubv( const GLubyte *v ) 363 { 364 GET_CONTEXT; 365 (*CC->API.Color4ub)( CC, v[0], v[1], v[2], 255 ); 366 } 367 368 369 void APIENTRY _mesa_Color3uiv( const GLuint *v ) 370 { 371 GET_CONTEXT; 372 (*CC->API.Color3f)( CC, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), 373 UINT_TO_FLOAT(v[2]) ); 374 } 375 376 377 void APIENTRY _mesa_Color3usv( const GLushort *v ) 378 { 379 GET_CONTEXT; 380 (*CC->API.Color3f)( CC, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]), 381 USHORT_TO_FLOAT(v[2]) ); 382 383 } 384 385 386 void APIENTRY _mesa_Color4bv( const GLbyte *v ) 387 { 388 GET_CONTEXT; 389 (*CC->API.Color4f)( CC, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), 390 BYTE_TO_FLOAT(v[2]), BYTE_TO_FLOAT(v[3]) ); 391 } 392 393 394 void APIENTRY _mesa_Color4dv( const GLdouble *v ) 395 { 396 GET_CONTEXT; 397 (*CC->API.Color4f)( CC, (GLdouble) v[0], (GLdouble) v[1], 398 (GLdouble) v[2], (GLdouble) v[3] ); 399 } 400 401 402 void APIENTRY _mesa_Color4fv( const GLfloat *v ) 403 { 404 GET_CONTEXT; 405 (*CC->API.Color4f)( CC, v[0], v[1], v[2], v[3] ); 406 } 407 408 409 void APIENTRY _mesa_Color4iv( const GLint *v ) 410 { 411 GET_CONTEXT; 412 (*CC->API.Color4f)( CC, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), 413 INT_TO_FLOAT(v[2]), INT_TO_FLOAT(v[3]) ); 414 } 415 416 417 void APIENTRY _mesa_Color4sv( const GLshort *v ) 418 { 419 GET_CONTEXT; 420 (*CC->API.Color4f)( CC, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), 421 SHORT_TO_FLOAT(v[2]), SHORT_TO_FLOAT(v[3]) ); 422 } 423 424 425 void APIENTRY _mesa_Color4ubv( const GLubyte *v ) 426 { 427 GET_CONTEXT; 428 (*CC->API.Color4ubv)( CC, v ); 429 } 430 431 432 void APIENTRY _mesa_Color4uiv( const GLuint *v ) 433 { 434 GET_CONTEXT; 435 (*CC->API.Color4f)( CC, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), 436 UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3]) ); 437 } 438 439 440 void APIENTRY _mesa_Color4usv( const GLushort *v ) 441 { 442 GET_CONTEXT; 443 (*CC->API.Color4f)( CC, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]), 444 USHORT_TO_FLOAT(v[2]), USHORT_TO_FLOAT(v[3]) ); 445 } 446 447 448 void APIENTRY _mesa_ColorMask( GLboolean red, GLboolean green, 449 GLboolean blue, GLboolean alpha ) 450 { 451 GET_CONTEXT; 452 (*CC->API.ColorMask)(CC, red, green, blue, alpha); 453 } 454 455 456 void APIENTRY _mesa_ColorMaterial( GLenum face, GLenum mode ) 457 { 458 GET_CONTEXT; 459 (*CC->API.ColorMaterial)(CC, face, mode); 460 } 461 462 463 void APIENTRY _mesa_ColorPointer( GLint size, GLenum type, GLsizei stride, 464 const GLvoid *ptr ) 465 { 466 GET_CONTEXT; 467 (*CC->API.ColorPointer)(CC, size, type, stride, ptr); 468 } 469 470 471 void APIENTRY _mesa_CopyPixels( GLint x, GLint y, GLsizei width, GLsizei height, 472 GLenum type ) 473 { 474 GET_CONTEXT; 475 (*CC->API.CopyPixels)(CC, x, y, width, height, type); 476 } 477 478 479 void APIENTRY _mesa_CopyTexImage1D( GLenum target, GLint level, 480 GLenum internalformat, 481 GLint x, GLint y, 482 GLsizei width, GLint border ) 483 { 484 GET_CONTEXT; 485 (*CC->API.CopyTexImage1D)( CC, target, level, internalformat, 486 x, y, width, border ); 487 } 488 489 490 void APIENTRY _mesa_CopyTexImage2D( GLenum target, GLint level, 491 GLenum internalformat, 492 GLint x, GLint y, 493 GLsizei width, GLsizei height, GLint border ) 494 { 495 GET_CONTEXT; 496 (*CC->API.CopyTexImage2D)( CC, target, level, internalformat, 497 x, y, width, height, border ); 498 } 499 500 501 void APIENTRY _mesa_CopyTexSubImage1D( GLenum target, GLint level, 502 GLint xoffset, GLint x, GLint y, 503 GLsizei width ) 504 { 505 GET_CONTEXT; 506 (*CC->API.CopyTexSubImage1D)( CC, target, level, xoffset, x, y, width ); 507 } 508 509 510 void APIENTRY _mesa_CopyTexSubImage2D( GLenum target, GLint level, 511 GLint xoffset, GLint yoffset, 512 GLint x, GLint y, 513 GLsizei width, GLsizei height ) 514 { 515 GET_CONTEXT; 516 (*CC->API.CopyTexSubImage2D)( CC, target, level, xoffset, yoffset, 517 x, y, width, height ); 518 } 519 520 521 522 void APIENTRY _mesa_CullFace( GLenum mode ) 523 { 524 GET_CONTEXT; 525 (*CC->API.CullFace)(CC, mode); 526 } 527 528 529 void APIENTRY _mesa_DepthFunc( GLenum func ) 530 { 531 GET_CONTEXT; 532 (*CC->API.DepthFunc)( CC, func ); 533 } 534 535 536 void APIENTRY _mesa_DepthMask( GLboolean flag ) 537 { 538 GET_CONTEXT; 539 (*CC->API.DepthMask)( CC, flag ); 540 } 541 542 543 void APIENTRY _mesa_DepthRange( GLclampd near_val, GLclampd far_val ) 544 { 545 GET_CONTEXT; 546 (*CC->API.DepthRange)( CC, near_val, far_val ); 547 } 548 549 550 void APIENTRY _mesa_DeleteLists( GLuint list, GLsizei range ) 551 { 552 GET_CONTEXT; 553 (*CC->API.DeleteLists)(CC, list, range); 554 } 555 556 557 void APIENTRY _mesa_DeleteTextures( GLsizei n, const GLuint *textures) 558 { 559 GET_CONTEXT; 560 (*CC->API.DeleteTextures)(CC, n, textures); 561 } 562 563 564 void APIENTRY _mesa_Disable( GLenum cap ) 565 { 566 GET_CONTEXT; 567 (*CC->API.Disable)( CC, cap ); 568 } 569 570 571 void APIENTRY _mesa_DisableClientState( GLenum cap ) 572 { 573 GET_CONTEXT; 574 (*CC->API.DisableClientState)( CC, cap ); 575 } 576 577 578 void APIENTRY _mesa_DrawArrays( GLenum mode, GLint first, GLsizei count ) 579 { 580 GET_CONTEXT; 581 (*CC->API.DrawArrays)(CC, mode, first, count); 582 } 583 584 585 void APIENTRY _mesa_DrawBuffer( GLenum mode ) 586 { 587 GET_CONTEXT; 588 (*CC->API.DrawBuffer)(CC, mode); 589 } 590 591 592 void APIENTRY _mesa_DrawElements( GLenum mode, GLsizei count, 593 GLenum type, const GLvoid *indices ) 594 { 595 GET_CONTEXT; 596 (*CC->API.DrawElements)( CC, mode, count, type, indices ); 597 } 598 599 600 void APIENTRY _mesa_DrawPixels( GLsizei width, GLsizei height, 601 GLenum format, GLenum type, const GLvoid *pixels ) 602 { 603 GET_CONTEXT; 604 (*CC->API.DrawPixels)( CC, width, height, format, type, pixels ); 605 } 606 607 608 void APIENTRY _mesa_Enable( GLenum cap ) 609 { 610 GET_CONTEXT; 611 (*CC->API.Enable)( CC, cap ); 612 } 613 614 615 void APIENTRY _mesa_EnableClientState( GLenum cap ) 616 { 617 GET_CONTEXT; 618 (*CC->API.EnableClientState)( CC, cap ); 619 } 620 621 622 void APIENTRY _mesa_End( void ) 623 { 624 GET_CONTEXT; 625 (*CC->API.End)( CC ); 626 } 627 628 629 void APIENTRY _mesa_EndList( void ) 630 { 631 GET_CONTEXT; 632 (*CC->API.EndList)(CC); 633 } 634 635 636 637 638 void APIENTRY _mesa_EvalCoord1d( GLdouble u ) 639 { 640 GET_CONTEXT; 641 (*CC->API.EvalCoord1f)( CC, (GLfloat) u ); 642 } 643 644 645 void APIENTRY _mesa_EvalCoord1f( GLfloat u ) 646 { 647 GET_CONTEXT; 648 (*CC->API.EvalCoord1f)( CC, u ); 649 } 650 651 652 void APIENTRY _mesa_EvalCoord1dv( const GLdouble *u ) 653 { 654 GET_CONTEXT; 655 (*CC->API.EvalCoord1f)( CC, (GLfloat) *u ); 656 } 657 658 659 void APIENTRY _mesa_EvalCoord1fv( const GLfloat *u ) 660 { 661 GET_CONTEXT; 662 (*CC->API.EvalCoord1f)( CC, (GLfloat) *u ); 663 } 664 665 666 void APIENTRY _mesa_EvalCoord2d( GLdouble u, GLdouble v ) 667 { 668 GET_CONTEXT; 669 (*CC->API.EvalCoord2f)( CC, (GLfloat) u, (GLfloat) v ); 670 } 671 672 673 void APIENTRY _mesa_EvalCoord2f( GLfloat u, GLfloat v ) 674 { 675 GET_CONTEXT; 676 (*CC->API.EvalCoord2f)( CC, u, v ); 677 } 678 679 680 void APIENTRY _mesa_EvalCoord2dv( const GLdouble *u ) 681 { 682 GET_CONTEXT; 683 (*CC->API.EvalCoord2f)( CC, (GLfloat) u[0], (GLfloat) u[1] ); 684 } 685 686 687 void APIENTRY _mesa_EvalCoord2fv( const GLfloat *u ) 688 { 689 GET_CONTEXT; 690 (*CC->API.EvalCoord2f)( CC, u[0], u[1] ); 691 } 692 693 694 void APIENTRY _mesa_EvalPoint1( GLint i ) 695 { 696 GET_CONTEXT; 697 (*CC->API.EvalPoint1)( CC, i ); 698 } 699 700 701 void APIENTRY _mesa_EvalPoint2( GLint i, GLint j ) 702 { 703 GET_CONTEXT; 704 (*CC->API.EvalPoint2)( CC, i, j ); 705 } 706 707 708 void APIENTRY _mesa_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) 709 { 710 GET_CONTEXT; 711 (*CC->API.EvalMesh1)( CC, mode, i1, i2 ); 712 } 713 714 715 void APIENTRY _mesa_EdgeFlag( GLboolean flag ) 716 { 717 GET_CONTEXT; 718 (*CC->API.EdgeFlag)(CC, flag); 719 } 720 721 722 void APIENTRY _mesa_EdgeFlagv( const GLboolean *flag ) 723 { 724 GET_CONTEXT; 725 (*CC->API.EdgeFlag)(CC, *flag); 726 } 727 728 729 void APIENTRY _mesa_EdgeFlagPointer( GLsizei stride, const GLboolean *ptr ) 730 { 731 GET_CONTEXT; 732 (*CC->API.EdgeFlagPointer)(CC, stride, ptr); 733 } 734 735 736 void APIENTRY _mesa_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) 737 { 738 GET_CONTEXT; 739 (*CC->API.EvalMesh2)( CC, mode, i1, i2, j1, j2 ); 740 } 741 742 743 void APIENTRY _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) 744 { 745 GET_CONTEXT; 746 (*CC->API.FeedbackBuffer)(CC, size, type, buffer); 747 } 748 749 750 void APIENTRY _mesa_Finish( void ) 751 { 752 GET_CONTEXT; 753 (*CC->API.Finish)(CC); 754 } 755 756 757 void APIENTRY _mesa_Flush( void ) 758 { 759 GET_CONTEXT; 760 (*CC->API.Flush)(CC); 761 } 762 763 764 void APIENTRY _mesa_Fogf( GLenum pname, GLfloat param ) 765 { 766 GET_CONTEXT; 767 (*CC->API.Fogfv)(CC, pname, ¶m); 768 } 769 770 771 void APIENTRY _mesa_Fogi( GLenum pname, GLint param ) 772 { 773 GLfloat fparam = (GLfloat) param; 774 GET_CONTEXT; 775 (*CC->API.Fogfv)(CC, pname, &fparam); 776 } 777 778 779 void APIENTRY _mesa_Fogfv( GLenum pname, const GLfloat *params ) 780 { 781 GET_CONTEXT; 782 (*CC->API.Fogfv)(CC, pname, params); 783 } 784 785 786 void APIENTRY _mesa_Fogiv( GLenum pname, const GLint *params ) 787 { 788 GLfloat p[4]; 789 GET_CONTEXT; 790 791 switch (pname) { 792 case GL_FOG_MODE: 793 case GL_FOG_DENSITY: 794 case GL_FOG_START: 795 case GL_FOG_END: 796 case GL_FOG_INDEX: 797 p[0] = (GLfloat) *params; 798 break; 799 case GL_FOG_COLOR: 800 p[0] = INT_TO_FLOAT( params[0] ); 801 p[1] = INT_TO_FLOAT( params[1] ); 802 p[2] = INT_TO_FLOAT( params[2] ); 803 p[3] = INT_TO_FLOAT( params[3] ); 804 break; 805 default: 806 /* Error will be caught later in gl_Fogfv */ 807 ; 808 } 809 (*CC->API.Fogfv)( CC, pname, p ); 810 } 811 812 813 814 void APIENTRY _mesa_FrontFace( GLenum mode ) 815 { 816 GET_CONTEXT; 817 (*CC->API.FrontFace)(CC, mode); 818 } 819 820 821 void APIENTRY _mesa_Frustum( GLdouble left, GLdouble right, 822 GLdouble bottom, GLdouble top, 823 GLdouble nearval, GLdouble farval ) 824 { 825 GET_CONTEXT; 826 (*CC->API.Frustum)(CC, left, right, bottom, top, nearval, farval); 827 } 828 829 830 GLuint APIENTRY _mesa_GenLists( GLsizei range ) 831 { 832 GET_CONTEXT; 833 return (*CC->API.GenLists)(CC, range); 834 } 835 836 837 void APIENTRY _mesa_GenTextures( GLsizei n, GLuint *textures ) 838 { 839 GET_CONTEXT; 840 (*CC->API.GenTextures)(CC, n, textures); 841 } 842 843 844 void APIENTRY _mesa_GetBooleanv( GLenum pname, GLboolean *params ) 845 { 846 GET_CONTEXT; 847 (*CC->API.GetBooleanv)(CC, pname, params); 848 } 849 850 851 void APIENTRY _mesa_GetClipPlane( GLenum plane, GLdouble *equation ) 852 { 853 GET_CONTEXT; 854 (*CC->API.GetClipPlane)(CC, plane, equation); 855 } 856 857 void APIENTRY _mesa_GetDoublev( GLenum pname, GLdouble *params ) 858 { 859 GET_CONTEXT; 860 (*CC->API.GetDoublev)(CC, pname, params); 861 } 862 863 864 GLenum APIENTRY _mesa_GetError( void ) 865 { 866 GET_CONTEXT; 867 if (!CC) { 868 /* No current context */ 869 return GL_NO_ERROR; 870 } 871 return (*CC->API.GetError)(CC); 872 } 873 874 875 void APIENTRY _mesa_GetFloatv( GLenum pname, GLfloat *params ) 876 { 877 GET_CONTEXT; 878 (*CC->API.GetFloatv)(CC, pname, params); 879 } 880 881 882 void APIENTRY _mesa_GetIntegerv( GLenum pname, GLint *params ) 883 { 884 GET_CONTEXT; 885 (*CC->API.GetIntegerv)(CC, pname, params); 886 } 887 888 889 void APIENTRY _mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params ) 890 { 891 GET_CONTEXT; 892 (*CC->API.GetLightfv)(CC, light, pname, params); 893 } 894 895 896 void APIENTRY _mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ) 897 { 898 GET_CONTEXT; 899 (*CC->API.GetLightiv)(CC, light, pname, params); 900 } 901 902 903 void APIENTRY _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) 904 { 905 GET_CONTEXT; 906 (*CC->API.GetMapdv)( CC, target, query, v ); 907 } 908 909 910 void APIENTRY _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) 911 { 912 GET_CONTEXT; 913 (*CC->API.GetMapfv)( CC, target, query, v ); 914 } 915 916 917 void APIENTRY _mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) 918 { 919 GET_CONTEXT; 920 (*CC->API.GetMapiv)( CC, target, query, v ); 921 } 922 923 924 void APIENTRY _mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params ) 925 { 926 GET_CONTEXT; 927 (*CC->API.GetMaterialfv)(CC, face, pname, params); 928 } 929 930 931 void APIENTRY _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ) 932 { 933 GET_CONTEXT; 934 (*CC->API.GetMaterialiv)(CC, face, pname, params); 935 } 936 937 938 void APIENTRY _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) 939 { 940 GET_CONTEXT; 941 (*CC->API.GetPixelMapfv)(CC, map, values); 942 } 943 944 945 void APIENTRY _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) 946 { 947 GET_CONTEXT; 948 (*CC->API.GetPixelMapuiv)(CC, map, values); 949 } 950 951 952 void APIENTRY _mesa_GetPixelMapusv( GLenum map, GLushort *values ) 953 { 954 GET_CONTEXT; 955 (*CC->API.GetPixelMapusv)(CC, map, values); 956 } 957 958 959 void APIENTRY _mesa_GetPointerv( GLenum pname, GLvoid **params ) 960 { 961 GET_CONTEXT; 962 (*CC->API.GetPointerv)(CC, pname, params); 963 } 964 965 966 void APIENTRY _mesa_GetPolygonStipple( GLubyte *mask ) 967 { 968 GET_CONTEXT; 969 (*CC->API.GetPolygonStipple)(CC, mask); 970 } 971 972 973 const GLubyte * APIENTRY _mesa_GetString( GLenum name ) 974 { 975 GET_CONTEXT; 976 return (*CC->API.GetString)(CC, name); 977 } 978 979 980 981 void APIENTRY _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) 982 { 983 GET_CONTEXT; 984 (*CC->API.GetTexEnvfv)(CC, target, pname, params); 985 } 986 987 988 void APIENTRY _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) 989 { 990 GET_CONTEXT; 991 (*CC->API.GetTexEnviv)(CC, target, pname, params); 992 } 993 994 995 void APIENTRY _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) 996 { 997 GET_CONTEXT; 998 (*CC->API.GetTexGeniv)(CC, coord, pname, params); 999 } 1000 1001 1002 void APIENTRY _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) 1003 { 1004 GET_CONTEXT; 1005 (*CC->API.GetTexGendv)(CC, coord, pname, params); 1006 } 1007 1008 1009 void APIENTRY _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) 1010 { 1011 GET_CONTEXT; 1012 (*CC->API.GetTexGenfv)(CC, coord, pname, params); 1013 } 1014 1015 1016 1017 void APIENTRY _mesa_GetTexImage( GLenum target, GLint level, GLenum format, 1018 GLenum type, GLvoid *pixels ) 1019 { 1020 GET_CONTEXT; 1021 (*CC->API.GetTexImage)(CC, target, level, format, type, pixels); 1022 } 1023 1024 1025 void APIENTRY _mesa_GetTexLevelParameterfv( GLenum target, GLint level, 1026 GLenum pname, GLfloat *params ) 1027 { 1028 GET_CONTEXT; 1029 (*CC->API.GetTexLevelParameterfv)(CC, target, level, pname, params); 1030 } 1031 1032 1033 void APIENTRY _mesa_GetTexLevelParameteriv( GLenum target, GLint level, 1034 GLenum pname, GLint *params ) 1035 { 1036 GET_CONTEXT; 1037 (*CC->API.GetTexLevelParameteriv)(CC, target, level, pname, params); 1038 } 1039 1040 1041 1042 1043 void APIENTRY _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params) 1044 { 1045 GET_CONTEXT; 1046 (*CC->API.GetTexParameterfv)(CC, target, pname, params); 1047 } 1048 1049 1050 void APIENTRY _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) 1051 { 1052 GET_CONTEXT; 1053 (*CC->API.GetTexParameteriv)(CC, target, pname, params); 1054 } 1055 1056 1057 void APIENTRY _mesa_Hint( GLenum target, GLenum mode ) 1058 { 1059 GET_CONTEXT; 1060 (*CC->API.Hint)(CC, target, mode); 1061 } 1062 1063 1064 void APIENTRY _mesa_Indexd( GLdouble c ) 1065 { 1066 GET_CONTEXT; 1067 (*CC->API.Indexf)( CC, (GLfloat) c ); 1068 } 1069 1070 1071 void APIENTRY _mesa_Indexf( GLfloat c ) 1072 { 1073 GET_CONTEXT; 1074 (*CC->API.Indexf)( CC, c ); 1075 } 1076 1077 1078 void APIENTRY _mesa_Indexi( GLint c ) 1079 { 1080 GET_CONTEXT; 1081 (*CC->API.Indexi)( CC, c ); 1082 } 1083 1084 1085 void APIENTRY _mesa_Indexs( GLshort c ) 1086 { 1087 GET_CONTEXT; 1088 (*CC->API.Indexi)( CC, (GLint) c ); 1089 } 1090 1091 1092 #ifdef GL_VERSION_1_1 1093 void APIENTRY _mesa_Indexub( GLubyte c ) 1094 { 1095 GET_CONTEXT; 1096 (*CC->API.Indexi)( CC, (GLint) c ); 1097 } 1098 #endif 1099 1100 1101 void APIENTRY _mesa_Indexdv( const GLdouble *c ) 1102 { 1103 GET_CONTEXT; 1104 (*CC->API.Indexf)( CC, (GLfloat) *c ); 1105 } 1106 1107 1108 void APIENTRY _mesa_Indexfv( const GLfloat *c ) 1109 { 1110 GET_CONTEXT; 1111 (*CC->API.Indexf)( CC, *c ); 1112 } 1113 1114 1115 void APIENTRY _mesa_Indexiv( const GLint *c ) 1116 { 1117 GET_CONTEXT; 1118 (*CC->API.Indexi)( CC, *c ); 1119 } 1120 1121 1122 void APIENTRY _mesa_Indexsv( const GLshort *c ) 1123 { 1124 GET_CONTEXT; 1125 (*CC->API.Indexi)( CC, (GLint) *c ); 1126 } 1127 1128 1129 #ifdef GL_VERSION_1_1 1130 void APIENTRY _mesa_Indexubv( const GLubyte *c ) 1131 { 1132 GET_CONTEXT; 1133 (*CC->API.Indexi)( CC, (GLint) *c ); 1134 } 1135 #endif 1136 1137 1138 void APIENTRY _mesa_IndexMask( GLuint mask ) 1139 { 1140 GET_CONTEXT; 1141 (*CC->API.IndexMask)(CC, mask); 1142 } 1143 1144 1145 void APIENTRY _mesa_IndexPointer( GLenum type, GLsizei stride, const GLvoid *ptr ) 1146 { 1147 GET_CONTEXT; 1148 (*CC->API.IndexPointer)(CC, type, stride, ptr); 1149 } 1150 1151 1152 void APIENTRY _mesa_InterleavedArrays( GLenum format, GLsizei stride, 1153 const GLvoid *pointer ) 1154 { 1155 GET_CONTEXT; 1156 (*CC->API.InterleavedArrays)( CC, format, stride, pointer ); 1157 } 1158 1159 1160 void APIENTRY _mesa_InitNames( void ) 1161 { 1162 GET_CONTEXT; 1163 (*CC->API.InitNames)(CC); 1164 } 1165 1166 1167 GLboolean APIENTRY _mesa_IsList( GLuint list ) 1168 { 1169 GET_CONTEXT; 1170 return (*CC->API.IsList)(CC, list); 1171 } 1172 1173 1174 GLboolean APIENTRY _mesa_IsTexture( GLuint texture ) 1175 { 1176 GET_CONTEXT; 1177 return (*CC->API.IsTexture)(CC, texture); 1178 } 1179 1180 1181 void APIENTRY _mesa_Lightf( GLenum light, GLenum pname, GLfloat param ) 1182 { 1183 GET_CONTEXT; 1184 (*CC->API.Lightfv)( CC, light, pname, ¶m, 1 ); 1185 } 1186 1187 1188 1189 void APIENTRY _mesa_Lighti( GLenum light, GLenum pname, GLint param ) 1190 { 1191 GLfloat fparam = (GLfloat) param; 1192 GET_CONTEXT; 1193 (*CC->API.Lightfv)( CC, light, pname, &fparam, 1 ); 1194 } 1195 1196 1197 1198 void APIENTRY _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) 1199 { 1200 GET_CONTEXT; 1201 (*CC->API.Lightfv)( CC, light, pname, params, 4 ); 1202 } 1203 1204 1205 1206 void APIENTRY _mesa_Lightiv( GLenum light, GLenum pname, const GLint *params ) 1207 { 1208 GLfloat fparam[4]; 1209 GET_CONTEXT; 1210 1211 switch (pname) { 1212 case GL_AMBIENT: 1213 case GL_DIFFUSE: 1214 case GL_SPECULAR: 1215 fparam[0] = INT_TO_FLOAT( params[0] ); 1216 fparam[1] = INT_TO_FLOAT( params[1] ); 1217 fparam[2] = INT_TO_FLOAT( params[2] ); 1218 fparam[3] = INT_TO_FLOAT( params[3] ); 1219 break; 1220 case GL_POSITION: 1221 fparam[0] = (GLfloat) params[0]; 1222 fparam[1] = (GLfloat) params[1]; 1223 fparam[2] = (GLfloat) params[2]; 1224 fparam[3] = (GLfloat) params[3]; 1225 break; 1226 case GL_SPOT_DIRECTION: 1227 fparam[0] = (GLfloat) params[0]; 1228 fparam[1] = (GLfloat) params[1]; 1229 fparam[2] = (GLfloat) params[2]; 1230 break; 1231 case GL_SPOT_EXPONENT: 1232 case GL_SPOT_CUTOFF: 1233 case GL_CONSTANT_ATTENUATION: 1234 case GL_LINEAR_ATTENUATION: 1235 case GL_QUADRATIC_ATTENUATION: 1236 fparam[0] = (GLfloat) params[0]; 1237 break; 1238 default: 1239 /* error will be caught later in gl_Lightfv */ 1240 ; 1241 } 1242 (*CC->API.Lightfv)( CC, light, pname, fparam, 4 ); 1243 } 1244 1245 1246 1247 void APIENTRY _mesa_LightModelf( GLenum pname, GLfloat param ) 1248 { 1249 GET_CONTEXT; 1250 (*CC->API.LightModelfv)( CC, pname, ¶m ); 1251 } 1252 1253 1254 void APIENTRY _mesa_LightModeli( GLenum pname, GLint param ) 1255 { 1256 GLfloat fparam[4]; 1257 GET_CONTEXT; 1258 fparam[0] = (GLfloat) param; 1259 (*CC->API.LightModelfv)( CC, pname, fparam ); 1260 } 1261 1262 1263 void APIENTRY _mesa_LightModelfv( GLenum pname, const GLfloat *params ) 1264 { 1265 GET_CONTEXT; 1266 (*CC->API.LightModelfv)( CC, pname, params ); 1267 } 1268 1269 1270 void APIENTRY _mesa_LightModeliv( GLenum pname, const GLint *params ) 1271 { 1272 GLfloat fparam[4]; 1273 GET_CONTEXT; 1274 1275 switch (pname) { 1276 case GL_LIGHT_MODEL_AMBIENT: 1277 fparam[0] = INT_TO_FLOAT( params[0] ); 1278 fparam[1] = INT_TO_FLOAT( params[1] ); 1279 fparam[2] = INT_TO_FLOAT( params[2] ); 1280 fparam[3] = INT_TO_FLOAT( params[3] ); 1281 break; 1282 case GL_LIGHT_MODEL_LOCAL_VIEWER: 1283 case GL_LIGHT_MODEL_TWO_SIDE: 1284 fparam[0] = (GLfloat) params[0]; 1285 break; 1286 default: 1287 /* Error will be caught later in gl_LightModelfv */ 1288 ; 1289 } 1290 (*CC->API.LightModelfv)( CC, pname, fparam ); 1291 } 1292 1293 1294 void APIENTRY _mesa_LineWidth( GLfloat width ) 1295 { 1296 GET_CONTEXT; 1297 (*CC->API.LineWidth)(CC, width); 1298 } 1299 1300 1301 void APIENTRY _mesa_LineStipple( GLint factor, GLushort pattern ) 1302 { 1303 GET_CONTEXT; 1304 (*CC->API.LineStipple)(CC, factor, pattern); 1305 } 1306 1307 1308 void APIENTRY _mesa_ListBase( GLuint base ) 1309 { 1310 GET_CONTEXT; 1311 (*CC->API.ListBase)(CC, base); 1312 } 1313 1314 1315 void APIENTRY _mesa_LoadIdentity( void ) 1316 { 1317 GET_CONTEXT; 1318 (*CC->API.LoadIdentity)( CC ); 1319 } 1320 1321 1322 void APIENTRY _mesa_LoadMatrixd( const GLdouble *m ) 1323 { 1324 GLfloat fm[16]; 1325 GLuint i; 1326 GET_CONTEXT; 1327 1328 for (i=0;i<16;i++) { 1329 fm[i] = (GLfloat) m[i]; 1330 } 1331 1332 (*CC->API.LoadMatrixf)( CC, fm ); 1333 } 1334 1335 1336 void APIENTRY _mesa_LoadMatrixf( const GLfloat *m ) 1337 { 1338 GET_CONTEXT; 1339 (*CC->API.LoadMatrixf)( CC, m ); 1340 } 1341 1342 1343 void APIENTRY _mesa_LoadName( GLuint name ) 1344 { 1345 GET_CONTEXT; 1346 (*CC->API.LoadName)(CC, name); 1347 } 1348 1349 1350 void APIENTRY _mesa_LogicOp( GLenum opcode ) 1351 { 1352 GET_CONTEXT; 1353 (*CC->API.LogicOp)(CC, opcode); 1354 } 1355 1356 1357 1358 void APIENTRY _mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, 1359 GLint order, const GLdouble *points ) 1360 { 1361 GLfloat *pnts; 1362 GLboolean retain; 1363 GET_CONTEXT; 1364 1365 pnts = gl_copy_map_points1d( target, stride, order, points ); 1366 retain = CC->CompileFlag; 1367 (*CC->API.Map1f)( CC, target, u1, u2, stride, order, pnts, retain ); 1368 } 1369 1370 1371 void APIENTRY _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, 1372 GLint order, const GLfloat *points ) 1373 { 1374 GLfloat *pnts; 1375 GLboolean retain; 1376 GET_CONTEXT; 1377 1378 pnts = gl_copy_map_points1f( target, stride, order, points ); 1379 retain = CC->CompileFlag; 1380 (*CC->API.Map1f)( CC, target, u1, u2, stride, order, pnts, retain ); 1381 } 1382 1383 1384 void APIENTRY _mesa_Map2d( GLenum target, 1385 GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, 1386 GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, 1387 const GLdouble *points ) 1388 { 1389 GLfloat *pnts; 1390 GLboolean retain; 1391 GET_CONTEXT; 1392 1393 pnts = gl_copy_map_points2d( target, ustride, uorder, 1394 vstride, vorder, points ); 1395 retain = CC->CompileFlag; 1396 (*CC->API.Map2f)( CC, target, u1, u2, ustride, uorder, 1397 v1, v2, vstride, vorder, pnts, retain ); 1398 } 1399 1400 1401 void APIENTRY _mesa_Map2f( GLenum target, 1402 GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, 1403 GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, 1404 const GLfloat *points ) 1405 { 1406 GLfloat *pnts; 1407 GLboolean retain; 1408 GET_CONTEXT; 1409 1410 pnts = gl_copy_map_points2f( target, ustride, uorder, 1411 vstride, vorder, points ); 1412 retain = CC->CompileFlag; 1413 (*CC->API.Map2f)( CC, target, u1, u2, ustride, uorder, 1414 v1, v2, vstride, vorder, pnts, retain ); 1415 } 1416 1417 1418 void APIENTRY _mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) 1419 { 1420 GET_CONTEXT; 1421 (*CC->API.MapGrid1f)( CC, un, (GLfloat) u1, (GLfloat) u2 ); 1422 } 1423 1424 1425 void APIENTRY _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) 1426 { 1427 GET_CONTEXT; 1428 (*CC->API.MapGrid1f)( CC, un, u1, u2 ); 1429 } 1430 1431 1432 void APIENTRY _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, 1433 GLint vn, GLdouble v1, GLdouble v2 ) 1434 { 1435 GET_CONTEXT; 1436 (*CC->API.MapGrid2f)( CC, un, (GLfloat) u1, (GLfloat) u2, 1437 vn, (GLfloat) v1, (GLfloat) v2 ); 1438 } 1439 1440 1441 void APIENTRY _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, 1442 GLint vn, GLfloat v1, GLfloat v2 ) 1443 { 1444 GET_CONTEXT; 1445 (*CC->API.MapGrid2f)( CC, un, u1, u2, vn, v1, v2 ); 1446 } 1447 1448 1449 void APIENTRY _mesa_Materialf( GLenum face, GLenum pname, GLfloat param ) 1450 { 1451 GET_CONTEXT; 1452 (*CC->API.Materialfv)( CC, face, pname, ¶m ); 1453 } 1454 1455 1456 1457 void APIENTRY _mesa_Materiali( GLenum face, GLenum pname, GLint param ) 1458 { 1459 GLfloat fparam[4]; 1460 GET_CONTEXT; 1461 fparam[0] = (GLfloat) param; 1462 (*CC->API.Materialfv)( CC, face, pname, fparam ); 1463 } 1464 1465 1466 void APIENTRY _mesa_Materialfv( GLenum face, GLenum pname, const GLfloat *params ) 1467 { 1468 GET_CONTEXT; 1469 (*CC->API.Materialfv)( CC, face, pname, params ); 1470 } 1471 1472 1473 void APIENTRY _mesa_Materialiv( GLenum face, GLenum pname, const GLint *params ) 1474 { 1475 GLfloat fparam[4]; 1476 GET_CONTEXT; 1477 switch (pname) { 1478 case GL_AMBIENT: 1479 case GL_DIFFUSE: 1480 case GL_SPECULAR: 1481 case GL_EMISSION: 1482 case GL_AMBIENT_AND_DIFFUSE: 1483 fparam[0] = INT_TO_FLOAT( params[0] ); 1484 fparam[1] = INT_TO_FLOAT( params[1] ); 1485 fparam[2] = INT_TO_FLOAT( params[2] ); 1486 fparam[3] = INT_TO_FLOAT( params[3] ); 1487 break; 1488 case GL_SHININESS: 1489 fparam[0] = (GLfloat) params[0]; 1490 break; 1491 case GL_COLOR_INDEXES: 1492 fparam[0] = (GLfloat) params[0]; 1493 fparam[1] = (GLfloat) params[1]; 1494 fparam[2] = (GLfloat) params[2]; 1495 break; 1496 default: 1497 /* Error will be caught later in gl_Materialfv */ 1498 ; 1499 } 1500 (*CC->API.Materialfv)( CC, face, pname, fparam ); 1501 } 1502 1503 1504 void APIENTRY _mesa_MatrixMode( GLenum mode ) 1505 { 1506 GET_CONTEXT; 1507 (*CC->API.MatrixMode)( CC, mode ); 1508 } 1509 1510 1511 void APIENTRY _mesa_MultMatrixd( const GLdouble *m ) 1512 { 1513 GLfloat fm[16]; 1514 GLuint i; 1515 GET_CONTEXT; 1516 1517 for (i=0;i<16;i++) { 1518 fm[i] = (GLfloat) m[i]; 1519 } 1520 1521 (*CC->API.MultMatrixf)( CC, fm ); 1522 } 1523 1524 1525 void APIENTRY _mesa_MultMatrixf( const GLfloat *m ) 1526 { 1527 GET_CONTEXT; 1528 (*CC->API.MultMatrixf)( CC, m ); 1529 } 1530 1531 1532 void APIENTRY _mesa_NewList( GLuint list, GLenum mode ) 1533 { 1534 GET_CONTEXT; 1535 (*CC->API.NewList)(CC, list, mode); 1536 } 1537 1538 void APIENTRY _mesa_Normal3b( GLbyte nx, GLbyte ny, GLbyte nz ) 1539 { 1540 GET_CONTEXT; 1541 (*CC->API.Normal3f)( CC, BYTE_TO_FLOAT(nx), 1542 BYTE_TO_FLOAT(ny), BYTE_TO_FLOAT(nz) ); 1543 } 1544 1545 1546 void APIENTRY _mesa_Normal3d( GLdouble nx, GLdouble ny, GLdouble nz ) 1547 { 1548 GLfloat fx, fy, fz; 1549 GET_CONTEXT; 1550 if (ABSD(nx)<0.00001) fx = 0.0F; else fx = nx; 1551 if (ABSD(ny)<0.00001) fy = 0.0F; else fy = ny; 1552 if (ABSD(nz)<0.00001) fz = 0.0F; else fz = nz; 1553 (*CC->API.Normal3f)( CC, fx, fy, fz ); 1554 } 1555 1556 1557 void APIENTRY _mesa_Normal3f( GLfloat nx, GLfloat ny, GLfloat nz ) 1558 { 1559 GET_CONTEXT; 1560 #ifdef SHORTCUT 1561 if (CC->CompileFlag) { 1562 (*CC->Save.Normal3f)( CC, nx, ny, nz ); 1563 } 1564 else { 1565 /* Execute */ 1566 CC->Current.Normal[0] = nx; 1567 CC->Current.Normal[1] = ny; 1568 CC->Current.Normal[2] = nz; 1569 CC->VB->MonoNormal = GL_FALSE; 1570 } 1571 #else 1572 (*CC->API.Normal3f)( CC, nx, ny, nz ); 1573 #endif 1574 } 1575 1576 1577 void APIENTRY _mesa_Normal3i( GLint nx, GLint ny, GLint nz ) 1578 { 1579 GET_CONTEXT; 1580 (*CC->API.Normal3f)( CC, INT_TO_FLOAT(nx), 1581 INT_TO_FLOAT(ny), INT_TO_FLOAT(nz) ); 1582 } 1583 1584 1585 void APIENTRY _mesa_Normal3s( GLshort nx, GLshort ny, GLshort nz ) 1586 { 1587 GET_CONTEXT; 1588 (*CC->API.Normal3f)( CC, SHORT_TO_FLOAT(nx), 1589 SHORT_TO_FLOAT(ny), SHORT_TO_FLOAT(nz) ); 1590 } 1591 1592 1593 void APIENTRY _mesa_Normal3bv( const GLbyte *v ) 1594 { 1595 GET_CONTEXT; 1596 (*CC->API.Normal3f)( CC, BYTE_TO_FLOAT(v[0]), 1597 BYTE_TO_FLOAT(v[1]), BYTE_TO_FLOAT(v[2]) ); 1598 } 1599 1600 1601 void APIENTRY _mesa_Normal3dv( const GLdouble *v ) 1602 { 1603 GLfloat fx, fy, fz; 1604 GET_CONTEXT; 1605 if (ABSD(v[0])<0.00001) fx = 0.0F; else fx = v[0]; 1606 if (ABSD(v[1])<0.00001) fy = 0.0F; else fy = v[1]; 1607 if (ABSD(v[2])<0.00001) fz = 0.0F; else fz = v[2]; 1608 (*CC->API.Normal3f)( CC, fx, fy, fz ); 1609 } 1610 1611 1612 void APIENTRY _mesa_Normal3fv( const GLfloat *v ) 1613 { 1614 GET_CONTEXT; 1615 #ifdef SHORTCUT 1616 if (CC->CompileFlag) { 1617 (*CC->Save.Normal3fv)( CC, v ); 1618 } 1619 else { 1620 /* Execute */ 1621 GLfloat *n = CC->Current.Normal; 1622 n[0] = v[0]; 1623 n[1] = v[1]; 1624 n[2] = v[2]; 1625 CC->VB->MonoNormal = GL_FALSE; 1626 } 1627 #else 1628 (*CC->API.Normal3fv)( CC, v ); 1629 #endif 1630 } 1631 1632 1633 void APIENTRY _mesa_Normal3iv( const GLint *v ) 1634 { 1635 GET_CONTEXT; 1636 (*CC->API.Normal3f)( CC, INT_TO_FLOAT(v[0]), 1637 INT_TO_FLOAT(v[1]), INT_TO_FLOAT(v[2]) ); 1638 } 1639 1640 1641 void APIENTRY _mesa_Normal3sv( const GLshort *v ) 1642 { 1643 GET_CONTEXT; 1644 (*CC->API.Normal3f)( CC, SHORT_TO_FLOAT(v[0]), 1645 SHORT_TO_FLOAT(v[1]), SHORT_TO_FLOAT(v[2]) ); 1646 } 1647 1648 1649 void APIENTRY _mesa_NormalPointer( GLenum type, GLsizei stride, const GLvoid *ptr ) 1650 { 1651 GET_CONTEXT; 1652 (*CC->API.NormalPointer)(CC, type, stride, ptr); 1653 } 1654 void APIENTRY _mesa_Ortho( GLdouble left, GLdouble right, 1655 GLdouble bottom, GLdouble top, 1656 GLdouble nearval, GLdouble farval ) 1657 { 1658 GET_CONTEXT; 1659 (*CC->API.Ortho)(CC, left, right, bottom, top, nearval, farval); 1660 } 1661 1662 1663 void APIENTRY _mesa_PassThrough( GLfloat token ) 1664 { 1665 GET_CONTEXT; 1666 (*CC->API.PassThrough)(CC, token); 1667 } 1668 1669 1670 void APIENTRY _mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) 1671 { 1672 GET_CONTEXT; 1673 (*CC->API.PixelMapfv)( CC, map, mapsize, values ); 1674 } 1675 1676 1677 void APIENTRY _mesa_PixelMapuiv( GLenum map, GLint mapsize, const GLuint *values ) 1678 { 1679 GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; 1680 GLuint i; 1681 GET_CONTEXT; 1682 1683 if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) { 1684 for (i=0;i<mapsize;i++) { 1685 fvalues[i] = (GLfloat) values[i]; 1686 } 1687 } 1688 else { 1689 for (i=0;i<mapsize;i++) { 1690 fvalues[i] = UINT_TO_FLOAT( values[i] ); 1691 } 1692 } 1693 (*CC->API.PixelMapfv)( CC, map, mapsize, fvalues ); 1694 } 1695 1696 1697 1698 void APIENTRY _mesa_PixelMapusv( GLenum map, GLint mapsize, const GLushort *values ) 1699 { 1700 GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; 1701 GLuint i; 1702 GET_CONTEXT; 1703 1704 if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) { 1705 for (i=0;i<mapsize;i++) { 1706 fvalues[i] = (GLfloat) values[i]; 1707 } 1708 } 1709 else { 1710 for (i=0;i<mapsize;i++) { 1711 fvalues[i] = USHORT_TO_FLOAT( values[i] ); 1712 } 1713 } 1714 (*CC->API.PixelMapfv)( CC, map, mapsize, fvalues ); 1715 } 1716 1717 1718 void APIENTRY _mesa_PixelStoref( GLenum pname, GLfloat param ) 1719 { 1720 GET_CONTEXT; 1721 (*CC->API.PixelStorei)( CC, pname, (GLint) param ); 1722 } 1723 1724 1725 void APIENTRY _mesa_PixelStorei( GLenum pname, GLint param ) 1726 { 1727 GET_CONTEXT; 1728 (*CC->API.PixelStorei)( CC, pname, param ); 1729 } 1730 1731 1732 void APIENTRY _mesa_PixelTransferf( GLenum pname, GLfloat param ) 1733 { 1734 GET_CONTEXT; 1735 (*CC->API.PixelTransferf)(CC, pname, param); 1736 } 1737 1738 1739 void APIENTRY _mesa_PixelTransferi( GLenum pname, GLint param ) 1740 { 1741 GET_CONTEXT; 1742 (*CC->API.PixelTransferf)(CC, pname, (GLfloat) param); 1743 } 1744 1745 1746 void APIENTRY _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ) 1747 { 1748 GET_CONTEXT; 1749 (*CC->API.PixelZoom)(CC, xfactor, yfactor); 1750 } 1751 1752 1753 void APIENTRY _mesa_PointSize( GLfloat size ) 1754 { 1755 GET_CONTEXT; 1756 (*CC->API.PointSize)(CC, size); 1757 } 1758 1759 1760 void APIENTRY _mesa_PolygonMode( GLenum face, GLenum mode ) 1761 { 1762 GET_CONTEXT; 1763 (*CC->API.PolygonMode)(CC, face, mode); 1764 } 1765 1766 1767 void APIENTRY _mesa_PolygonOffset( GLfloat factor, GLfloat units ) 1768 { 1769 GET_CONTEXT; 1770 (*CC->API.PolygonOffset)( CC, factor, units ); 1771 } 1772 1773 void APIENTRY _mesa_PolygonStipple( const GLubyte *mask ) 1774 { 1775 GET_CONTEXT; 1776 (*CC->API.PolygonStipple)(CC, mask); 1777 } 1778 1779 1780 void APIENTRY _mesa_PopAttrib( void ) 1781 { 1782 GET_CONTEXT; 1783 (*CC->API.PopAttrib)(CC); 1784 } 1785 1786 1787 void APIENTRY _mesa_PopClientAttrib( void ) 1788 { 1789 GET_CONTEXT; 1790 (*CC->API.PopClientAttrib)(CC); 1791 } 1792 1793 1794 void APIENTRY _mesa_PopMatrix( void ) 1795 { 1796 GET_CONTEXT; 1797 (*CC->API.PopMatrix)( CC ); 1798 } 1799 1800 1801 void APIENTRY _mesa_PopName( void ) 1802 { 1803 GET_CONTEXT; 1804 (*CC->API.PopName)(CC); 1805 } 1806 1807 1808 void APIENTRY _mesa_PrioritizeTextures( GLsizei n, const GLuint *textures, 1809 const GLclampf *priorities ) 1810 { 1811 GET_CONTEXT; 1812 (*CC->API.PrioritizeTextures)(CC, n, textures, priorities); 1813 } 1814 1815 1816 void APIENTRY _mesa_PushMatrix( void ) 1817 { 1818 GET_CONTEXT; 1819 (*CC->API.PushMatrix)( CC ); 1820 } 1821 1822 1823 void APIENTRY _mesa_RasterPos2d( GLdouble x, GLdouble y ) 1824 { 1825 GET_CONTEXT; 1826 (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F ); 1827 } 1828 1829 1830 void APIENTRY _mesa_RasterPos2f( GLfloat x, GLfloat y ) 1831 { 1832 GET_CONTEXT; 1833 (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F ); 1834 } 1835 1836 1837 void APIENTRY _mesa_RasterPos2i( GLint x, GLint y ) 1838 { 1839 GET_CONTEXT; 1840 (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F ); 1841 } 1842 1843 1844 void APIENTRY _mesa_RasterPos2s( GLshort x, GLshort y ) 1845 { 1846 GET_CONTEXT; 1847 (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F ); 1848 } 1849 1850 1851 void APIENTRY _mesa_RasterPos3d( GLdouble x, GLdouble y, GLdouble z ) 1852 { 1853 GET_CONTEXT; 1854 (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F ); 1855 } 1856 1857 1858 void APIENTRY _mesa_RasterPos3f( GLfloat x, GLfloat y, GLfloat z ) 1859 { 1860 GET_CONTEXT; 1861 (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F ); 1862 } 1863 1864 1865 void APIENTRY _mesa_RasterPos3i( GLint x, GLint y, GLint z ) 1866 { 1867 GET_CONTEXT; 1868 (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F ); 1869 } 1870 1871 1872 void APIENTRY _mesa_RasterPos3s( GLshort x, GLshort y, GLshort z ) 1873 { 1874 GET_CONTEXT; 1875 (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F ); 1876 } 1877 1878 1879 void APIENTRY _mesa_RasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ) 1880 { 1881 GET_CONTEXT; 1882 (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 1883 (GLfloat) z, (GLfloat) w ); 1884 } 1885 1886 1887 void APIENTRY _mesa_RasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) 1888 { 1889 GET_CONTEXT; 1890 (*CC->API.RasterPos4f)( CC, x, y, z, w ); 1891 } 1892 1893 1894 void APIENTRY _mesa_RasterPos4i( GLint x, GLint y, GLint z, GLint w ) 1895 { 1896 GET_CONTEXT; 1897 (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 1898 (GLfloat) z, (GLfloat) w ); 1899 } 1900 1901 1902 void APIENTRY _mesa_RasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ) 1903 { 1904 GET_CONTEXT; 1905 (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 1906 (GLfloat) z, (GLfloat) w ); 1907 } 1908 1909 1910 void APIENTRY _mesa_RasterPos2dv( const GLdouble *v ) 1911 { 1912 GET_CONTEXT; 1913 (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F ); 1914 } 1915 1916 1917 void APIENTRY _mesa_RasterPos2fv( const GLfloat *v ) 1918 { 1919 GET_CONTEXT; 1920 (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F ); 1921 } 1922 1923 1924 void APIENTRY _mesa_RasterPos2iv( const GLint *v ) 1925 { 1926 GET_CONTEXT; 1927 (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F ); 1928 } 1929 1930 1931 void APIENTRY _mesa_RasterPos2sv( const GLshort *v ) 1932 { 1933 GET_CONTEXT; 1934 (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F ); 1935 } 1936 1937 1938 /*** 3 element vector ***/ 1939 1940 void APIENTRY _mesa_RasterPos3dv( const GLdouble *v ) 1941 { 1942 GET_CONTEXT; 1943 (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 1944 (GLfloat) v[2], 1.0F ); 1945 } 1946 1947 1948 void APIENTRY _mesa_RasterPos3fv( const GLfloat *v ) 1949 { 1950 GET_CONTEXT; 1951 (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 1952 (GLfloat) v[2], 1.0F ); 1953 } 1954 1955 1956 void APIENTRY _mesa_RasterPos3iv( const GLint *v ) 1957 { 1958 GET_CONTEXT; 1959 (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 1960 (GLfloat) v[2], 1.0F ); 1961 } 1962 1963 1964 void APIENTRY _mesa_RasterPos3sv( const GLshort *v ) 1965 { 1966 GET_CONTEXT; 1967 (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 1968 (GLfloat) v[2], 1.0F ); 1969 } 1970 1971 1972 void APIENTRY _mesa_RasterPos4dv( const GLdouble *v ) 1973 { 1974 GET_CONTEXT; 1975 (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 1976 (GLfloat) v[2], (GLfloat) v[3] ); 1977 } 1978 1979 1980 void APIENTRY _mesa_RasterPos4fv( const GLfloat *v ) 1981 { 1982 GET_CONTEXT; 1983 (*CC->API.RasterPos4f)( CC, v[0], v[1], v[2], v[3] ); 1984 } 1985 1986 1987 void APIENTRY _mesa_RasterPos4iv( const GLint *v ) 1988 { 1989 GET_CONTEXT; 1990 (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 1991 (GLfloat) v[2], (GLfloat) v[3] ); 1992 } 1993 1994 1995 void APIENTRY _mesa_RasterPos4sv( const GLshort *v ) 1996 { 1997 GET_CONTEXT; 1998 (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 1999 (GLfloat) v[2], (GLfloat) v[3] ); 2000 } 2001 2002 2003 void APIENTRY _mesa_ReadBuffer( GLenum mode ) 2004 { 2005 GET_CONTEXT; 2006 (*CC->API.ReadBuffer)( CC, mode ); 2007 } 2008 2009 2010 void APIENTRY _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, 2011 GLenum format, GLenum type, GLvoid *pixels ) 2012 { 2013 GET_CONTEXT; 2014 (*CC->API.ReadPixels)( CC, x, y, width, height, format, type, pixels ); 2015 } 2016 2017 2018 void APIENTRY _mesa_Rectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ) 2019 { 2020 GET_CONTEXT; 2021 (*CC->API.Rectf)( CC, (GLfloat) x1, (GLfloat) y1, 2022 (GLfloat) x2, (GLfloat) y2 ); 2023 } 2024 2025 2026 void APIENTRY _mesa_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) 2027 { 2028 GET_CONTEXT; 2029 (*CC->API.Rectf)( CC, x1, y1, x2, y2 ); 2030 } 2031 2032 2033 void APIENTRY _mesa_Recti( GLint x1, GLint y1, GLint x2, GLint y2 ) 2034 { 2035 GET_CONTEXT; 2036 (*CC->API.Rectf)( CC, (GLfloat) x1, (GLfloat) y1, 2037 (GLfloat) x2, (GLfloat) y2 ); 2038 } 2039 2040 2041 void APIENTRY _mesa_Rects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ) 2042 { 2043 GET_CONTEXT; 2044 (*CC->API.Rectf)( CC, (GLfloat) x1, (GLfloat) y1, 2045 (GLfloat) x2, (GLfloat) y2 ); 2046 } 2047 2048 2049 void APIENTRY _mesa_Rectdv( const GLdouble *v1, const GLdouble *v2 ) 2050 { 2051 GET_CONTEXT; 2052 (*CC->API.Rectf)(CC, (GLfloat) v1[0], (GLfloat) v1[1], 2053 (GLfloat) v2[0], (GLfloat) v2[1]); 2054 } 2055 2056 2057 void APIENTRY _mesa_Rectfv( const GLfloat *v1, const GLfloat *v2 ) 2058 { 2059 GET_CONTEXT; 2060 (*CC->API.Rectf)(CC, v1[0], v1[1], v2[0], v2[1]); 2061 } 2062 2063 2064 void APIENTRY _mesa_Rectiv( const GLint *v1, const GLint *v2 ) 2065 { 2066 GET_CONTEXT; 2067 (*CC->API.Rectf)( CC, (GLfloat) v1[0], (GLfloat) v1[1], 2068 (GLfloat) v2[0], (GLfloat) v2[1] ); 2069 } 2070 2071 2072 void APIENTRY _mesa_Rectsv( const GLshort *v1, const GLshort *v2 ) 2073 { 2074 GET_CONTEXT; 2075 (*CC->API.Rectf)(CC, (GLfloat) v1[0], (GLfloat) v1[1], 2076 (GLfloat) v2[0], (GLfloat) v2[1]); 2077 } 2078 2079 2080 void APIENTRY _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height) 2081 { 2082 GET_CONTEXT; 2083 (*CC->API.Scissor)(CC, x, y, width, height); 2084 } 2085 2086 2087 GLboolean APIENTRY _mesa_IsEnabled( GLenum cap ) 2088 { 2089 GET_CONTEXT; 2090 return (*CC->API.IsEnabled)( CC, cap ); 2091 } 2092 2093 2094 2095 void APIENTRY _mesa_PushAttrib( GLbitfield mask ) 2096 { 2097 GET_CONTEXT; 2098 (*CC->API.PushAttrib)(CC, mask); 2099 } 2100 2101 2102 void APIENTRY _mesa_PushClientAttrib( GLbitfield mask ) 2103 { 2104 GET_CONTEXT; 2105 (*CC->API.PushClientAttrib)(CC, mask); 2106 } 2107 2108 2109 void APIENTRY _mesa_PushName( GLuint name ) 2110 { 2111 GET_CONTEXT; 2112 (*CC->API.PushName)(CC, name); 2113 } 2114 2115 2116 GLint APIENTRY _mesa_RenderMode( GLenum mode ) 2117 { 2118 GET_CONTEXT; 2119 return (*CC->API.RenderMode)(CC, mode); 2120 } 2121 2122 2123 void APIENTRY _mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ) 2124 { 2125 GET_CONTEXT; 2126 (*CC->API.Rotatef)( CC, (GLfloat) angle, 2127 (GLfloat) x, (GLfloat) y, (GLfloat) z ); 2128 } 2129 2130 2131 void APIENTRY _mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) 2132 { 2133 GET_CONTEXT; 2134 (*CC->API.Rotatef)( CC, angle, x, y, z ); 2135 } 2136 2137 2138 void APIENTRY _mesa_SelectBuffer( GLsizei size, GLuint *buffer ) 2139 { 2140 GET_CONTEXT; 2141 (*CC->API.SelectBuffer)(CC, size, buffer); 2142 } 2143 2144 2145 void APIENTRY _mesa_Scaled( GLdouble x, GLdouble y, GLdouble z ) 2146 { 2147 GET_CONTEXT; 2148 (*CC->API.Scalef)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z ); 2149 } 2150 2151 2152 void APIENTRY _mesa_Scalef( GLfloat x, GLfloat y, GLfloat z ) 2153 { 2154 GET_CONTEXT; 2155 (*CC->API.Scalef)( CC, x, y, z ); 2156 } 2157 2158 2159 void APIENTRY _mesa_ShadeModel( GLenum mode ) 2160 { 2161 GET_CONTEXT; 2162 (*CC->API.ShadeModel)(CC, mode); 2163 } 2164 2165 2166 void APIENTRY _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) 2167 { 2168 GET_CONTEXT; 2169 (*CC->API.StencilFunc)(CC, func, ref, mask); 2170 } 2171 2172 2173 void APIENTRY _mesa_StencilMask( GLuint mask ) 2174 { 2175 GET_CONTEXT; 2176 (*CC->API.StencilMask)(CC, mask); 2177 } 2178 2179 2180 void APIENTRY _mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ) 2181 { 2182 GET_CONTEXT; 2183 (*CC->API.StencilOp)(CC, fail, zfail, zpass); 2184 } 2185 2186 2187 void APIENTRY _mesa_TexCoord1d( GLdouble s ) 2188 { 2189 GET_CONTEXT; 2190 (*CC->API.TexCoord4f)( CC, (GLfloat) s, 0.0, 0.0, 1.0 ); 2191 } 2192 2193 2194 void APIENTRY _mesa_TexCoord1f( GLfloat s ) 2195 { 2196 GET_CONTEXT; 2197 (*CC->API.TexCoord4f)( CC, s, 0.0, 0.0, 1.0 ); 2198 } 2199 2200 2201 void APIENTRY _mesa_TexCoord1i( GLint s ) 2202 { 2203 GET_CONTEXT; 2204 (*CC->API.TexCoord4f)( CC, (GLfloat) s, 0.0, 0.0, 1.0 ); 2205 } 2206 2207 2208 void APIENTRY _mesa_TexCoord1s( GLshort s ) 2209 { 2210 GET_CONTEXT; 2211 (*CC->API.TexCoord4f)( CC, (GLfloat) s, 0.0, 0.0, 1.0 ); 2212 } 2213 2214 2215 void APIENTRY _mesa_TexCoord2d( GLdouble s, GLdouble t ) 2216 { 2217 GET_CONTEXT; 2218 (*CC->API.TexCoord2f)( CC, (GLfloat) s, (GLfloat) t ); 2219 } 2220 2221 2222 void APIENTRY _mesa_TexCoord2f( GLfloat s, GLfloat t ) 2223 { 2224 GET_CONTEXT; 2225 (*CC->API.TexCoord2f)( CC, s, t ); 2226 } 2227 2228 2229 void APIENTRY _mesa_TexCoord2i( GLint s, GLint t ) 2230 { 2231 GET_CONTEXT; 2232 (*CC->API.TexCoord2f)( CC, (GLfloat) s, (GLfloat) t ); 2233 } 2234 2235 2236 void APIENTRY _mesa_TexCoord2s( GLshort s, GLshort t ) 2237 { 2238 GET_CONTEXT; 2239 (*CC->API.TexCoord2f)( CC, (GLfloat) s, (GLfloat) t ); 2240 } 2241 2242 2243 void APIENTRY _mesa_TexCoord3d( GLdouble s, GLdouble t, GLdouble r ) 2244 { 2245 GET_CONTEXT; 2246 (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, (GLfloat) r, 1.0 ); 2247 } 2248 2249 2250 void APIENTRY _mesa_TexCoord3f( GLfloat s, GLfloat t, GLfloat r ) 2251 { 2252 GET_CONTEXT; 2253 (*CC->API.TexCoord4f)( CC, s, t, r, 1.0 ); 2254 } 2255 2256 2257 void APIENTRY _mesa_TexCoord3i( GLint s, GLint t, GLint r ) 2258 { 2259 GET_CONTEXT; 2260 (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, 2261 (GLfloat) r, 1.0 ); 2262 } 2263 2264 2265 void APIENTRY _mesa_TexCoord3s( GLshort s, GLshort t, GLshort r ) 2266 { 2267 GET_CONTEXT; 2268 (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, 2269 (GLfloat) r, 1.0 ); 2270 } 2271 2272 2273 void APIENTRY _mesa_TexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ) 2274 { 2275 GET_CONTEXT; 2276 (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, 2277 (GLfloat) r, (GLfloat) q ); 2278 } 2279 2280 2281 void APIENTRY _mesa_TexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ) 2282 { 2283 GET_CONTEXT; 2284 (*CC->API.TexCoord4f)( CC, s, t, r, q ); 2285 } 2286 2287 2288 void APIENTRY _mesa_TexCoord4i( GLint s, GLint t, GLint r, GLint q ) 2289 { 2290 GET_CONTEXT; 2291 (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, 2292 (GLfloat) r, (GLfloat) q ); 2293 } 2294 2295 2296 void APIENTRY _mesa_TexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ) 2297 { 2298 GET_CONTEXT; 2299 (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, 2300 (GLfloat) r, (GLfloat) q ); 2301 } 2302 2303 2304 void APIENTRY _mesa_TexCoord1dv( const GLdouble *v ) 2305 { 2306 GET_CONTEXT; 2307 (*CC->API.TexCoord4f)( CC, (GLfloat) *v, 0.0, 0.0, 1.0 ); 2308 } 2309 2310 2311 void APIENTRY _mesa_TexCoord1fv( const GLfloat *v ) 2312 { 2313 GET_CONTEXT; 2314 (*CC->API.TexCoord4f)( CC, *v, 0.0, 0.0, 1.0 ); 2315 } 2316 2317 2318 void APIENTRY _mesa_TexCoord1iv( const GLint *v ) 2319 { 2320 GET_CONTEXT; 2321 (*CC->API.TexCoord4f)( CC, *v, 0.0, 0.0, 1.0 ); 2322 } 2323 2324 2325 void APIENTRY _mesa_TexCoord1sv( const GLshort *v ) 2326 { 2327 GET_CONTEXT; 2328 (*CC->API.TexCoord4f)( CC, (GLfloat) *v, 0.0, 0.0, 1.0 ); 2329 } 2330 2331 2332 void APIENTRY _mesa_TexCoord2dv( const GLdouble *v ) 2333 { 2334 GET_CONTEXT; 2335 (*CC->API.TexCoord2f)( CC, (GLfloat) v[0], (GLfloat) v[1] ); 2336 } 2337 2338 2339 void APIENTRY _mesa_TexCoord2fv( const GLfloat *v ) 2340 { 2341 GET_CONTEXT; 2342 (*CC->API.TexCoord2f)( CC, v[0], v[1] ); 2343 } 2344 2345 2346 void APIENTRY _mesa_TexCoord2iv( const GLint *v ) 2347 { 2348 GET_CONTEXT; 2349 (*CC->API.TexCoord2f)( CC, (GLfloat) v[0], (GLfloat) v[1] ); 2350 } 2351 2352 2353 void APIENTRY _mesa_TexCoord2sv( const GLshort *v ) 2354 { 2355 GET_CONTEXT; 2356 (*CC->API.TexCoord2f)( CC, (GLfloat) v[0], (GLfloat) v[1] ); 2357 } 2358 2359 2360 void APIENTRY _mesa_TexCoord3dv( const GLdouble *v ) 2361 { 2362 GET_CONTEXT; 2363 (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 2364 (GLfloat) v[2], 1.0 ); 2365 } 2366 2367 2368 void APIENTRY _mesa_TexCoord3fv( const GLfloat *v ) 2369 { 2370 GET_CONTEXT; 2371 (*CC->API.TexCoord4f)( CC, v[0], v[1], v[2], 1.0 ); 2372 } 2373 2374 2375 void APIENTRY _mesa_TexCoord3iv( const GLint *v ) 2376 { 2377 GET_CONTEXT; 2378 (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 2379 (GLfloat) v[2], 1.0 ); 2380 } 2381 2382 2383 void APIENTRY _mesa_TexCoord3sv( const GLshort *v ) 2384 { 2385 GET_CONTEXT; 2386 (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 2387 (GLfloat) v[2], 1.0 ); 2388 } 2389 2390 2391 void APIENTRY _mesa_TexCoord4dv( const GLdouble *v ) 2392 { 2393 GET_CONTEXT; 2394 (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 2395 (GLfloat) v[2], (GLfloat) v[3] ); 2396 } 2397 2398 2399 void APIENTRY _mesa_TexCoord4fv( const GLfloat *v ) 2400 { 2401 GET_CONTEXT; 2402 (*CC->API.TexCoord4f)( CC, v[0], v[1], v[2], v[3] ); 2403 } 2404 2405 2406 void APIENTRY _mesa_TexCoord4iv( const GLint *v ) 2407 { 2408 GET_CONTEXT; 2409 (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 2410 (GLfloat) v[2], (GLfloat) v[3] ); 2411 } 2412 2413 2414 void APIENTRY _mesa_TexCoord4sv( const GLshort *v ) 2415 { 2416 GET_CONTEXT; 2417 (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 2418 (GLfloat) v[2], (GLfloat) v[3] ); 2419 } 2420 2421 2422 void APIENTRY _mesa_TexCoordPointer( GLint size, GLenum type, GLsizei stride, 2423 const GLvoid *ptr ) 2424 { 2425 GET_CONTEXT; 2426 (*CC->API.TexCoordPointer)(CC, size, type, stride, ptr); 2427 } 2428 2429 2430 void APIENTRY _mesa_TexGend( GLenum coord, GLenum pname, GLdouble param ) 2431 { 2432 GLfloat p = (GLfloat) param; 2433 GET_CONTEXT; 2434 (*CC->API.TexGenfv)( CC, coord, pname, &p ); 2435 } 2436 2437 2438 void APIENTRY _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) 2439 { 2440 GET_CONTEXT; 2441 (*CC->API.TexGenfv)( CC, coord, pname, ¶m ); 2442 } 2443 2444 2445 void APIENTRY _mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) 2446 { 2447 GLfloat p = (GLfloat) param; 2448 GET_CONTEXT; 2449 (*CC->API.TexGenfv)( CC, coord, pname, &p ); 2450 } 2451 2452 2453 void APIENTRY _mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params ) 2454 { 2455 GLfloat p[4]; 2456 GET_CONTEXT; 2457 p[0] = params[0]; 2458 p[1] = params[1]; 2459 p[2] = params[2]; 2460 p[3] = params[3]; 2461 (*CC->API.TexGenfv)( CC, coord, pname, p ); 2462 } 2463 2464 2465 void APIENTRY _mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ) 2466 { 2467 GLfloat p[4]; 2468 GET_CONTEXT; 2469 p[0] = params[0]; 2470 p[1] = params[1]; 2471 p[2] = params[2]; 2472 p[3] = params[3]; 2473 (*CC->API.TexGenfv)( CC, coord, pname, p ); 2474 } 2475 2476 2477 void APIENTRY _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) 2478 { 2479 GET_CONTEXT; 2480 (*CC->API.TexGenfv)( CC, coord, pname, params ); 2481 } 2482 2483 2484 2485 2486 void APIENTRY _mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ) 2487 { 2488 GET_CONTEXT; 2489 (*CC->API.TexEnvfv)( CC, target, pname, ¶m ); 2490 } 2491 2492 2493 2494 void APIENTRY _mesa_TexEnvi( GLenum target, GLenum pname, GLint param ) 2495 { 2496 GLfloat p[4]; 2497 GET_CONTEXT; 2498 p[0] = (GLfloat) param; 2499 p[1] = p[2] = p[3] = 0.0; 2500 (*CC->API.TexEnvfv)( CC, target, pname, p ); 2501 } 2502 2503 2504 2505 void APIENTRY _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) 2506 { 2507 GET_CONTEXT; 2508 (*CC->API.TexEnvfv)( CC, target, pname, param ); 2509 } 2510 2511 2512 2513 void APIENTRY _mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ) 2514 { 2515 GLfloat p[4]; 2516 GET_CONTEXT; 2517 p[0] = INT_TO_FLOAT( param[0] ); 2518 p[1] = INT_TO_FLOAT( param[1] ); 2519 p[2] = INT_TO_FLOAT( param[2] ); 2520 p[3] = INT_TO_FLOAT( param[3] ); 2521 (*CC->API.TexEnvfv)( CC, target, pname, p ); 2522 } 2523 2524 2525 void APIENTRY _mesa_TexImage1D( GLenum target, GLint level, GLint internalformat, 2526 GLsizei width, GLint border, 2527 GLenum format, GLenum type, const GLvoid *pixels ) 2528 { 2529 struct gl_image *teximage; 2530 GET_CONTEXT; 2531 teximage = gl_unpack_image( CC, width, 1, format, type, pixels ); 2532 (*CC->API.TexImage1D)( CC, target, level, internalformat, 2533 width, border, format, type, teximage ); 2534 } 2535 2536 2537 2538 void APIENTRY _mesa_TexImage2D( GLenum target, GLint level, GLint internalformat, 2539 GLsizei width, GLsizei height, GLint border, 2540 GLenum format, GLenum type, const GLvoid *pixels ) 2541 { 2542 struct gl_image *teximage; 2543 2544 GET_CONTEXT; 2545 2546 teximage = gl_unpack_image( CC, width, height, format, type, pixels ); 2547 (*CC->API.TexImage2D)( CC, target, level, internalformat, 2548 width, height, border, format, type, teximage ); 2549 } 2550 2551 2552 void APIENTRY _mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ) 2553 { 2554 GET_CONTEXT; 2555 (*CC->API.TexParameterfv)( CC, target, pname, ¶m ); 2556 } 2557 2558 2559 void APIENTRY _mesa_TexParameteri( GLenum target, GLenum pname, GLint param ) 2560 { 2561 GLfloat fparam[4]; 2562 GET_CONTEXT; 2563 fparam[0] = (GLfloat) param; 2564 fparam[1] = fparam[2] = fparam[3] = 0.0; 2565 (*CC->API.TexParameterfv)( CC, target, pname, fparam ); 2566 } 2567 2568 2569 void APIENTRY _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) 2570 { 2571 GET_CONTEXT; 2572 (*CC->API.TexParameterfv)( CC, target, pname, params ); 2573 } 2574 2575 2576 void APIENTRY _mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ) 2577 { 2578 GLfloat p[4]; 2579 GET_CONTEXT; 2580 if (pname==GL_TEXTURE_BORDER_COLOR) { 2581 p[0] = INT_TO_FLOAT( params[0] ); 2582 p[1] = INT_TO_FLOAT( params[1] ); 2583 p[2] = INT_TO_FLOAT( params[2] ); 2584 p[3] = INT_TO_FLOAT( params[3] ); 2585 } 2586 else { 2587 p[0] = (GLfloat) params[0]; 2588 p[1] = (GLfloat) params[1]; 2589 p[2] = (GLfloat) params[2]; 2590 p[3] = (GLfloat) params[3]; 2591 } 2592 (*CC->API.TexParameterfv)( CC, target, pname, p ); 2593 } 2594 2595 2596 void APIENTRY _mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset, 2597 GLsizei width, GLenum format, 2598 GLenum type, const GLvoid *pixels ) 2599 { 2600 struct gl_image *image; 2601 GET_CONTEXT; 2602 image = gl_unpack_texsubimage( CC, width, 1, format, type, pixels ); 2603 (*CC->API.TexSubImage1D)( CC, target, level, xoffset, width, 2604 format, type, image ); 2605 } 2606 2607 2608 void APIENTRY _mesa_TexSubImage2D( GLenum target, GLint level, 2609 GLint xoffset, GLint yoffset, 2610 GLsizei width, GLsizei height, 2611 GLenum format, GLenum type, 2612 const GLvoid *pixels ) 2613 { 2614 struct gl_image *image; 2615 GET_CONTEXT; 2616 image = gl_unpack_texsubimage( CC, width, height, format, type, pixels ); 2617 (*CC->API.TexSubImage2D)( CC, target, level, xoffset, yoffset, 2618 width, height, format, type, image ); 2619 } 2620 2621 2622 void APIENTRY _mesa_Translated( GLdouble x, GLdouble y, GLdouble z ) 2623 { 2624 GET_CONTEXT; 2625 (*CC->API.Translatef)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z ); 2626 } 2627 2628 2629 void APIENTRY _mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ) 2630 { 2631 GET_CONTEXT; 2632 (*CC->API.Translatef)( CC, x, y, z ); 2633 } 2634 2635 2636 void APIENTRY _mesa_Vertex2d( GLdouble x, GLdouble y ) 2637 { 2638 GET_CONTEXT; 2639 (*CC->API.Vertex2f)( CC, (GLfloat) x, (GLfloat) y ); 2640 } 2641 2642 2643 void APIENTRY _mesa_Vertex2f( GLfloat x, GLfloat y ) 2644 { 2645 GET_CONTEXT; 2646 (*CC->API.Vertex2f)( CC, x, y ); 2647 } 2648 2649 2650 void APIENTRY _mesa_Vertex2i( GLint x, GLint y ) 2651 { 2652 GET_CONTEXT; 2653 (*CC->API.Vertex2f)( CC, (GLfloat) x, (GLfloat) y ); 2654 } 2655 2656 2657 void APIENTRY _mesa_Vertex2s( GLshort x, GLshort y ) 2658 { 2659 GET_CONTEXT; 2660 (*CC->API.Vertex2f)( CC, (GLfloat) x, (GLfloat) y ); 2661 } 2662 2663 2664 void APIENTRY _mesa_Vertex3d( GLdouble x, GLdouble y, GLdouble z ) 2665 { 2666 GET_CONTEXT; 2667 (*CC->API.Vertex3f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z ); 2668 } 2669 2670 2671 void APIENTRY _mesa_Vertex3f( GLfloat x, GLfloat y, GLfloat z ) 2672 { 2673 GET_CONTEXT; 2674 (*CC->API.Vertex3f)( CC, x, y, z ); 2675 } 2676 2677 2678 void APIENTRY _mesa_Vertex3i( GLint x, GLint y, GLint z ) 2679 { 2680 GET_CONTEXT; 2681 (*CC->API.Vertex3f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z ); 2682 } 2683 2684 2685 void APIENTRY _mesa_Vertex3s( GLshort x, GLshort y, GLshort z ) 2686 { 2687 GET_CONTEXT; 2688 (*CC->API.Vertex3f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z ); 2689 } 2690 2691 2692 void APIENTRY _mesa_Vertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ) 2693 { 2694 GET_CONTEXT; 2695 (*CC->API.Vertex4f)( CC, (GLfloat) x, (GLfloat) y, 2696 (GLfloat) z, (GLfloat) w ); 2697 } 2698 2699 2700 void APIENTRY _mesa_Vertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) 2701 { 2702 GET_CONTEXT; 2703 (*CC->API.Vertex4f)( CC, x, y, z, w ); 2704 } 2705 2706 2707 void APIENTRY _mesa_Vertex4i( GLint x, GLint y, GLint z, GLint w ) 2708 { 2709 GET_CONTEXT; 2710 (*CC->API.Vertex4f)( CC, (GLfloat) x, (GLfloat) y, 2711 (GLfloat) z, (GLfloat) w ); 2712 } 2713 2714 2715 void APIENTRY _mesa_Vertex4s( GLshort x, GLshort y, GLshort z, GLshort w ) 2716 { 2717 GET_CONTEXT; 2718 (*CC->API.Vertex4f)( CC, (GLfloat) x, (GLfloat) y, 2719 (GLfloat) z, (GLfloat) w ); 2720 } 2721 2722 2723 void APIENTRY _mesa_Vertex2dv( const GLdouble *v ) 2724 { 2725 GET_CONTEXT; 2726 (*CC->API.Vertex2f)( CC, (GLfloat) v[0], (GLfloat) v[1] ); 2727 } 2728 2729 2730 void APIENTRY _mesa_Vertex2fv( const GLfloat *v ) 2731 { 2732 GET_CONTEXT; 2733 (*CC->API.Vertex2f)( CC, v[0], v[1] ); 2734 } 2735 2736 2737 void APIENTRY _mesa_Vertex2iv( const GLint *v ) 2738 { 2739 GET_CONTEXT; 2740 (*CC->API.Vertex2f)( CC, (GLfloat) v[0], (GLfloat) v[1] ); 2741 } 2742 2743 2744 void APIENTRY _mesa_Vertex2sv( const GLshort *v ) 2745 { 2746 GET_CONTEXT; 2747 (*CC->API.Vertex2f)( CC, (GLfloat) v[0], (GLfloat) v[1] ); 2748 } 2749 2750 2751 void APIENTRY _mesa_Vertex3dv( const GLdouble *v ) 2752 { 2753 GET_CONTEXT; 2754 (*CC->API.Vertex3f)( CC, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); 2755 } 2756 2757 2758 void APIENTRY _mesa_Vertex3fv( const GLfloat *v ) 2759 { 2760 GET_CONTEXT; 2761 (*CC->API.Vertex3fv)( CC, v ); 2762 } 2763 2764 2765 void APIENTRY _mesa_Vertex3iv( const GLint *v ) 2766 { 2767 GET_CONTEXT; 2768 (*CC->API.Vertex3f)( CC, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); 2769 } 2770 2771 2772 void APIENTRY _mesa_Vertex3sv( const GLshort *v ) 2773 { 2774 GET_CONTEXT; 2775 (*CC->API.Vertex3f)( CC, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); 2776 } 2777 2778 2779 void APIENTRY _mesa_Vertex4dv( const GLdouble *v ) 2780 { 2781 GET_CONTEXT; 2782 (*CC->API.Vertex4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 2783 (GLfloat) v[2], (GLfloat) v[3] ); 2784 } 2785 2786 2787 void APIENTRY _mesa_Vertex4fv( const GLfloat *v ) 2788 { 2789 GET_CONTEXT; 2790 (*CC->API.Vertex4f)( CC, v[0], v[1], v[2], v[3] ); 2791 } 2792 2793 2794 void APIENTRY _mesa_Vertex4iv( const GLint *v ) 2795 { 2796 GET_CONTEXT; 2797 (*CC->API.Vertex4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 2798 (GLfloat) v[2], (GLfloat) v[3] ); 2799 } 2800 2801 2802 void APIENTRY _mesa_Vertex4sv( const GLshort *v ) 2803 { 2804 GET_CONTEXT; 2805 (*CC->API.Vertex4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 2806 (GLfloat) v[2], (GLfloat) v[3] ); 2807 } 2808 2809 2810 void APIENTRY _mesa_VertexPointer( GLint size, GLenum type, GLsizei stride, 2811 const GLvoid *ptr ) 2812 { 2813 GET_CONTEXT; 2814 (*CC->API.VertexPointer)(CC, size, type, stride, ptr); 2815 } 2816 2817 2818 void APIENTRY _mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ) 2819 { 2820 GET_CONTEXT; 2821 (*CC->API.Viewport)( CC, x, y, width, height ); 2822 } 2823 2824 /* GL_EXT_paletted_texture */ 2825 2826 void APIENTRY _mesa_ColorTableEXT( GLenum target, GLenum internalFormat, 2827 GLsizei width, GLenum format, GLenum type, 2828 const GLvoid *table ) 2829 { 2830 struct gl_image *image; 2831 GET_CONTEXT; 2832 image = gl_unpack_image( CC, width, 1, format, type, table ); 2833 (*CC->API.ColorTable)( CC, target, internalFormat, image ); 2834 if (image->RefCount == 0) 2835 gl_free_image(image); 2836 } 2837 2838 2839 void APIENTRY _mesa_ColorSubTableEXT( GLenum target, GLsizei start, GLsizei count, 2840 GLenum format, GLenum type, 2841 const GLvoid *data ) 2842 { 2843 struct gl_image *image; 2844 GET_CONTEXT; 2845 image = gl_unpack_image( CC, count, 1, format, type, data ); 2846 (*CC->API.ColorSubTable)( CC, target, start, image ); 2847 if (image->RefCount == 0) 2848 gl_free_image(image); 2849 } 2850 2851 void APIENTRY _mesa_GetColorTableEXT( GLenum target, GLenum format, 2852 GLenum type, GLvoid *table ) 2853 { 2854 GET_CONTEXT; 2855 (*CC->API.GetColorTable)(CC, target, format, type, table); 2856 } 2857 2858 2859 void APIENTRY _mesa_GetColorTableParameterivEXT( GLenum target, GLenum pname, 2860 GLint *params ) 2861 { 2862 GET_CONTEXT; 2863 (*CC->API.GetColorTableParameteriv)(CC, target, pname, params); 2864 } 2865 2866 2867 void APIENTRY _mesa_GetColorTableParameterfvEXT( GLenum target, GLenum pname, 2868 GLfloat *params ) 2869 { 2870 GLint iparams; 2871 _mesa_GetColorTableParameterivEXT( target, pname, &iparams ); 2872 *params = (GLfloat) iparams; 2873 } 2874 /* End GL_EXT_paletted_texture */ 2875