gldebug.go (81198B)
1 // Copyright 2014 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Code generated from gl.go using go generate. DO NOT EDIT. 6 // See doc.go for details. 7 8 // +build darwin linux openbsd windows 9 // +build gldebug 10 11 package gl 12 13 import ( 14 "fmt" 15 "log" 16 "math" 17 "sync/atomic" 18 "unsafe" 19 ) 20 21 func (ctx *context) errDrain() string { 22 var errs []Enum 23 for { 24 e := ctx.GetError() 25 if e == 0 { 26 break 27 } 28 errs = append(errs, e) 29 } 30 if len(errs) > 0 { 31 return fmt.Sprintf(" error: %v", errs) 32 } 33 return "" 34 } 35 36 func (ctx *context) enqueueDebug(c call) uintptr { 37 numCalls := atomic.AddInt32(&ctx.debug, 1) 38 if numCalls > 1 { 39 panic("concurrent calls made to the same GL context") 40 } 41 defer func() { 42 if atomic.AddInt32(&ctx.debug, -1) > 0 { 43 select {} // block so you see us in the panic 44 } 45 }() 46 47 return ctx.enqueue(c) 48 } 49 50 func (v Enum) String() string { 51 switch v { 52 case 0x0: 53 return "0" 54 case 0x1: 55 return "1" 56 case 0x2: 57 return "2" 58 case 0x3: 59 return "LINE_STRIP" 60 case 0x4: 61 return "4" 62 case 0x5: 63 return "TRIANGLE_STRIP" 64 case 0x6: 65 return "TRIANGLE_FAN" 66 case 0x300: 67 return "SRC_COLOR" 68 case 0x301: 69 return "ONE_MINUS_SRC_COLOR" 70 case 0x302: 71 return "SRC_ALPHA" 72 case 0x303: 73 return "ONE_MINUS_SRC_ALPHA" 74 case 0x304: 75 return "DST_ALPHA" 76 case 0x305: 77 return "ONE_MINUS_DST_ALPHA" 78 case 0x306: 79 return "DST_COLOR" 80 case 0x307: 81 return "ONE_MINUS_DST_COLOR" 82 case 0x308: 83 return "SRC_ALPHA_SATURATE" 84 case 0x8006: 85 return "FUNC_ADD" 86 case 0x8009: 87 return "32777" 88 case 0x883d: 89 return "BLEND_EQUATION_ALPHA" 90 case 0x800a: 91 return "FUNC_SUBTRACT" 92 case 0x800b: 93 return "FUNC_REVERSE_SUBTRACT" 94 case 0x80c8: 95 return "BLEND_DST_RGB" 96 case 0x80c9: 97 return "BLEND_SRC_RGB" 98 case 0x80ca: 99 return "BLEND_DST_ALPHA" 100 case 0x80cb: 101 return "BLEND_SRC_ALPHA" 102 case 0x8001: 103 return "CONSTANT_COLOR" 104 case 0x8002: 105 return "ONE_MINUS_CONSTANT_COLOR" 106 case 0x8003: 107 return "CONSTANT_ALPHA" 108 case 0x8004: 109 return "ONE_MINUS_CONSTANT_ALPHA" 110 case 0x8005: 111 return "BLEND_COLOR" 112 case 0x8892: 113 return "ARRAY_BUFFER" 114 case 0x8893: 115 return "ELEMENT_ARRAY_BUFFER" 116 case 0x8894: 117 return "ARRAY_BUFFER_BINDING" 118 case 0x8895: 119 return "ELEMENT_ARRAY_BUFFER_BINDING" 120 case 0x88e0: 121 return "STREAM_DRAW" 122 case 0x88e4: 123 return "STATIC_DRAW" 124 case 0x88e8: 125 return "DYNAMIC_DRAW" 126 case 0x8764: 127 return "BUFFER_SIZE" 128 case 0x8765: 129 return "BUFFER_USAGE" 130 case 0x8626: 131 return "CURRENT_VERTEX_ATTRIB" 132 case 0x404: 133 return "FRONT" 134 case 0x405: 135 return "BACK" 136 case 0x408: 137 return "FRONT_AND_BACK" 138 case 0xde1: 139 return "TEXTURE_2D" 140 case 0xb44: 141 return "CULL_FACE" 142 case 0xbe2: 143 return "BLEND" 144 case 0xbd0: 145 return "DITHER" 146 case 0xb90: 147 return "STENCIL_TEST" 148 case 0xb71: 149 return "DEPTH_TEST" 150 case 0xc11: 151 return "SCISSOR_TEST" 152 case 0x8037: 153 return "POLYGON_OFFSET_FILL" 154 case 0x809e: 155 return "SAMPLE_ALPHA_TO_COVERAGE" 156 case 0x80a0: 157 return "SAMPLE_COVERAGE" 158 case 0x500: 159 return "INVALID_ENUM" 160 case 0x501: 161 return "INVALID_VALUE" 162 case 0x502: 163 return "INVALID_OPERATION" 164 case 0x505: 165 return "OUT_OF_MEMORY" 166 case 0x900: 167 return "CW" 168 case 0x901: 169 return "CCW" 170 case 0xb21: 171 return "LINE_WIDTH" 172 case 0x846d: 173 return "ALIASED_POINT_SIZE_RANGE" 174 case 0x846e: 175 return "ALIASED_LINE_WIDTH_RANGE" 176 case 0xb45: 177 return "CULL_FACE_MODE" 178 case 0xb46: 179 return "FRONT_FACE" 180 case 0xb70: 181 return "DEPTH_RANGE" 182 case 0xb72: 183 return "DEPTH_WRITEMASK" 184 case 0xb73: 185 return "DEPTH_CLEAR_VALUE" 186 case 0xb74: 187 return "DEPTH_FUNC" 188 case 0xb91: 189 return "STENCIL_CLEAR_VALUE" 190 case 0xb92: 191 return "STENCIL_FUNC" 192 case 0xb94: 193 return "STENCIL_FAIL" 194 case 0xb95: 195 return "STENCIL_PASS_DEPTH_FAIL" 196 case 0xb96: 197 return "STENCIL_PASS_DEPTH_PASS" 198 case 0xb97: 199 return "STENCIL_REF" 200 case 0xb93: 201 return "STENCIL_VALUE_MASK" 202 case 0xb98: 203 return "STENCIL_WRITEMASK" 204 case 0x8800: 205 return "STENCIL_BACK_FUNC" 206 case 0x8801: 207 return "STENCIL_BACK_FAIL" 208 case 0x8802: 209 return "STENCIL_BACK_PASS_DEPTH_FAIL" 210 case 0x8803: 211 return "STENCIL_BACK_PASS_DEPTH_PASS" 212 case 0x8ca3: 213 return "STENCIL_BACK_REF" 214 case 0x8ca4: 215 return "STENCIL_BACK_VALUE_MASK" 216 case 0x8ca5: 217 return "STENCIL_BACK_WRITEMASK" 218 case 0xba2: 219 return "VIEWPORT" 220 case 0xc10: 221 return "SCISSOR_BOX" 222 case 0xc22: 223 return "COLOR_CLEAR_VALUE" 224 case 0xc23: 225 return "COLOR_WRITEMASK" 226 case 0xcf5: 227 return "UNPACK_ALIGNMENT" 228 case 0xd05: 229 return "PACK_ALIGNMENT" 230 case 0xd33: 231 return "MAX_TEXTURE_SIZE" 232 case 0xd3a: 233 return "MAX_VIEWPORT_DIMS" 234 case 0xd50: 235 return "SUBPIXEL_BITS" 236 case 0xd52: 237 return "RED_BITS" 238 case 0xd53: 239 return "GREEN_BITS" 240 case 0xd54: 241 return "BLUE_BITS" 242 case 0xd55: 243 return "ALPHA_BITS" 244 case 0xd56: 245 return "DEPTH_BITS" 246 case 0xd57: 247 return "STENCIL_BITS" 248 case 0x2a00: 249 return "POLYGON_OFFSET_UNITS" 250 case 0x8038: 251 return "POLYGON_OFFSET_FACTOR" 252 case 0x8069: 253 return "TEXTURE_BINDING_2D" 254 case 0x80a8: 255 return "SAMPLE_BUFFERS" 256 case 0x80a9: 257 return "SAMPLES" 258 case 0x80aa: 259 return "SAMPLE_COVERAGE_VALUE" 260 case 0x80ab: 261 return "SAMPLE_COVERAGE_INVERT" 262 case 0x86a2: 263 return "NUM_COMPRESSED_TEXTURE_FORMATS" 264 case 0x86a3: 265 return "COMPRESSED_TEXTURE_FORMATS" 266 case 0x1100: 267 return "DONT_CARE" 268 case 0x1101: 269 return "FASTEST" 270 case 0x1102: 271 return "NICEST" 272 case 0x8192: 273 return "GENERATE_MIPMAP_HINT" 274 case 0x1400: 275 return "BYTE" 276 case 0x1401: 277 return "UNSIGNED_BYTE" 278 case 0x1402: 279 return "SHORT" 280 case 0x1403: 281 return "UNSIGNED_SHORT" 282 case 0x1404: 283 return "INT" 284 case 0x1405: 285 return "UNSIGNED_INT" 286 case 0x1406: 287 return "FLOAT" 288 case 0x140c: 289 return "FIXED" 290 case 0x1902: 291 return "DEPTH_COMPONENT" 292 case 0x1906: 293 return "ALPHA" 294 case 0x1907: 295 return "RGB" 296 case 0x1908: 297 return "RGBA" 298 case 0x1909: 299 return "LUMINANCE" 300 case 0x190a: 301 return "LUMINANCE_ALPHA" 302 case 0x8033: 303 return "UNSIGNED_SHORT_4_4_4_4" 304 case 0x8034: 305 return "UNSIGNED_SHORT_5_5_5_1" 306 case 0x8363: 307 return "UNSIGNED_SHORT_5_6_5" 308 case 0x8869: 309 return "MAX_VERTEX_ATTRIBS" 310 case 0x8dfb: 311 return "MAX_VERTEX_UNIFORM_VECTORS" 312 case 0x8dfc: 313 return "MAX_VARYING_VECTORS" 314 case 0x8b4d: 315 return "MAX_COMBINED_TEXTURE_IMAGE_UNITS" 316 case 0x8b4c: 317 return "MAX_VERTEX_TEXTURE_IMAGE_UNITS" 318 case 0x8872: 319 return "MAX_TEXTURE_IMAGE_UNITS" 320 case 0x8dfd: 321 return "MAX_FRAGMENT_UNIFORM_VECTORS" 322 case 0x8b4f: 323 return "SHADER_TYPE" 324 case 0x8b80: 325 return "DELETE_STATUS" 326 case 0x8b82: 327 return "LINK_STATUS" 328 case 0x8b83: 329 return "VALIDATE_STATUS" 330 case 0x8b85: 331 return "ATTACHED_SHADERS" 332 case 0x8b86: 333 return "ACTIVE_UNIFORMS" 334 case 0x8b87: 335 return "ACTIVE_UNIFORM_MAX_LENGTH" 336 case 0x8b89: 337 return "ACTIVE_ATTRIBUTES" 338 case 0x8b8a: 339 return "ACTIVE_ATTRIBUTE_MAX_LENGTH" 340 case 0x8b8c: 341 return "SHADING_LANGUAGE_VERSION" 342 case 0x8b8d: 343 return "CURRENT_PROGRAM" 344 case 0x200: 345 return "NEVER" 346 case 0x201: 347 return "LESS" 348 case 0x202: 349 return "EQUAL" 350 case 0x203: 351 return "LEQUAL" 352 case 0x204: 353 return "GREATER" 354 case 0x205: 355 return "NOTEQUAL" 356 case 0x206: 357 return "GEQUAL" 358 case 0x207: 359 return "ALWAYS" 360 case 0x1e00: 361 return "KEEP" 362 case 0x1e01: 363 return "REPLACE" 364 case 0x1e02: 365 return "INCR" 366 case 0x1e03: 367 return "DECR" 368 case 0x150a: 369 return "INVERT" 370 case 0x8507: 371 return "INCR_WRAP" 372 case 0x8508: 373 return "DECR_WRAP" 374 case 0x1f00: 375 return "VENDOR" 376 case 0x1f01: 377 return "RENDERER" 378 case 0x1f02: 379 return "VERSION" 380 case 0x1f03: 381 return "EXTENSIONS" 382 case 0x2600: 383 return "NEAREST" 384 case 0x2601: 385 return "LINEAR" 386 case 0x2700: 387 return "NEAREST_MIPMAP_NEAREST" 388 case 0x2701: 389 return "LINEAR_MIPMAP_NEAREST" 390 case 0x2702: 391 return "NEAREST_MIPMAP_LINEAR" 392 case 0x2703: 393 return "LINEAR_MIPMAP_LINEAR" 394 case 0x2800: 395 return "TEXTURE_MAG_FILTER" 396 case 0x2801: 397 return "TEXTURE_MIN_FILTER" 398 case 0x2802: 399 return "TEXTURE_WRAP_S" 400 case 0x2803: 401 return "TEXTURE_WRAP_T" 402 case 0x1702: 403 return "TEXTURE" 404 case 0x8513: 405 return "TEXTURE_CUBE_MAP" 406 case 0x8514: 407 return "TEXTURE_BINDING_CUBE_MAP" 408 case 0x8515: 409 return "TEXTURE_CUBE_MAP_POSITIVE_X" 410 case 0x8516: 411 return "TEXTURE_CUBE_MAP_NEGATIVE_X" 412 case 0x8517: 413 return "TEXTURE_CUBE_MAP_POSITIVE_Y" 414 case 0x8518: 415 return "TEXTURE_CUBE_MAP_NEGATIVE_Y" 416 case 0x8519: 417 return "TEXTURE_CUBE_MAP_POSITIVE_Z" 418 case 0x851a: 419 return "TEXTURE_CUBE_MAP_NEGATIVE_Z" 420 case 0x851c: 421 return "MAX_CUBE_MAP_TEXTURE_SIZE" 422 case 0x84c0: 423 return "TEXTURE0" 424 case 0x84c1: 425 return "TEXTURE1" 426 case 0x84c2: 427 return "TEXTURE2" 428 case 0x84c3: 429 return "TEXTURE3" 430 case 0x84c4: 431 return "TEXTURE4" 432 case 0x84c5: 433 return "TEXTURE5" 434 case 0x84c6: 435 return "TEXTURE6" 436 case 0x84c7: 437 return "TEXTURE7" 438 case 0x84c8: 439 return "TEXTURE8" 440 case 0x84c9: 441 return "TEXTURE9" 442 case 0x84ca: 443 return "TEXTURE10" 444 case 0x84cb: 445 return "TEXTURE11" 446 case 0x84cc: 447 return "TEXTURE12" 448 case 0x84cd: 449 return "TEXTURE13" 450 case 0x84ce: 451 return "TEXTURE14" 452 case 0x84cf: 453 return "TEXTURE15" 454 case 0x84d0: 455 return "TEXTURE16" 456 case 0x84d1: 457 return "TEXTURE17" 458 case 0x84d2: 459 return "TEXTURE18" 460 case 0x84d3: 461 return "TEXTURE19" 462 case 0x84d4: 463 return "TEXTURE20" 464 case 0x84d5: 465 return "TEXTURE21" 466 case 0x84d6: 467 return "TEXTURE22" 468 case 0x84d7: 469 return "TEXTURE23" 470 case 0x84d8: 471 return "TEXTURE24" 472 case 0x84d9: 473 return "TEXTURE25" 474 case 0x84da: 475 return "TEXTURE26" 476 case 0x84db: 477 return "TEXTURE27" 478 case 0x84dc: 479 return "TEXTURE28" 480 case 0x84dd: 481 return "TEXTURE29" 482 case 0x84de: 483 return "TEXTURE30" 484 case 0x84df: 485 return "TEXTURE31" 486 case 0x84e0: 487 return "ACTIVE_TEXTURE" 488 case 0x2901: 489 return "REPEAT" 490 case 0x812f: 491 return "CLAMP_TO_EDGE" 492 case 0x8370: 493 return "MIRRORED_REPEAT" 494 case 0x8622: 495 return "VERTEX_ATTRIB_ARRAY_ENABLED" 496 case 0x8623: 497 return "VERTEX_ATTRIB_ARRAY_SIZE" 498 case 0x8624: 499 return "VERTEX_ATTRIB_ARRAY_STRIDE" 500 case 0x8625: 501 return "VERTEX_ATTRIB_ARRAY_TYPE" 502 case 0x886a: 503 return "VERTEX_ATTRIB_ARRAY_NORMALIZED" 504 case 0x8645: 505 return "VERTEX_ATTRIB_ARRAY_POINTER" 506 case 0x889f: 507 return "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" 508 case 0x8b9a: 509 return "IMPLEMENTATION_COLOR_READ_TYPE" 510 case 0x8b9b: 511 return "IMPLEMENTATION_COLOR_READ_FORMAT" 512 case 0x8b81: 513 return "COMPILE_STATUS" 514 case 0x8b84: 515 return "INFO_LOG_LENGTH" 516 case 0x8b88: 517 return "SHADER_SOURCE_LENGTH" 518 case 0x8dfa: 519 return "SHADER_COMPILER" 520 case 0x8df8: 521 return "SHADER_BINARY_FORMATS" 522 case 0x8df9: 523 return "NUM_SHADER_BINARY_FORMATS" 524 case 0x8df0: 525 return "LOW_FLOAT" 526 case 0x8df1: 527 return "MEDIUM_FLOAT" 528 case 0x8df2: 529 return "HIGH_FLOAT" 530 case 0x8df3: 531 return "LOW_INT" 532 case 0x8df4: 533 return "MEDIUM_INT" 534 case 0x8df5: 535 return "HIGH_INT" 536 case 0x8d40: 537 return "FRAMEBUFFER" 538 case 0x8d41: 539 return "RENDERBUFFER" 540 case 0x8056: 541 return "RGBA4" 542 case 0x8057: 543 return "RGB5_A1" 544 case 0x8d62: 545 return "RGB565" 546 case 0x81a5: 547 return "DEPTH_COMPONENT16" 548 case 0x8d48: 549 return "STENCIL_INDEX8" 550 case 0x8d42: 551 return "RENDERBUFFER_WIDTH" 552 case 0x8d43: 553 return "RENDERBUFFER_HEIGHT" 554 case 0x8d44: 555 return "RENDERBUFFER_INTERNAL_FORMAT" 556 case 0x8d50: 557 return "RENDERBUFFER_RED_SIZE" 558 case 0x8d51: 559 return "RENDERBUFFER_GREEN_SIZE" 560 case 0x8d52: 561 return "RENDERBUFFER_BLUE_SIZE" 562 case 0x8d53: 563 return "RENDERBUFFER_ALPHA_SIZE" 564 case 0x8d54: 565 return "RENDERBUFFER_DEPTH_SIZE" 566 case 0x8d55: 567 return "RENDERBUFFER_STENCIL_SIZE" 568 case 0x8cd0: 569 return "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" 570 case 0x8cd1: 571 return "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" 572 case 0x8cd2: 573 return "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" 574 case 0x8cd3: 575 return "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" 576 case 0x8ce0: 577 return "COLOR_ATTACHMENT0" 578 case 0x8d00: 579 return "DEPTH_ATTACHMENT" 580 case 0x8d20: 581 return "STENCIL_ATTACHMENT" 582 case 0x8cd5: 583 return "FRAMEBUFFER_COMPLETE" 584 case 0x8cd6: 585 return "FRAMEBUFFER_INCOMPLETE_ATTACHMENT" 586 case 0x8cd7: 587 return "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" 588 case 0x8cd9: 589 return "FRAMEBUFFER_INCOMPLETE_DIMENSIONS" 590 case 0x8cdd: 591 return "FRAMEBUFFER_UNSUPPORTED" 592 case 0x8ca6: 593 return "36006" 594 case 0x8ca7: 595 return "RENDERBUFFER_BINDING" 596 case 0x84e8: 597 return "MAX_RENDERBUFFER_SIZE" 598 case 0x506: 599 return "INVALID_FRAMEBUFFER_OPERATION" 600 case 0x100: 601 return "DEPTH_BUFFER_BIT" 602 case 0x400: 603 return "STENCIL_BUFFER_BIT" 604 case 0x4000: 605 return "COLOR_BUFFER_BIT" 606 case 0x8b50: 607 return "FLOAT_VEC2" 608 case 0x8b51: 609 return "FLOAT_VEC3" 610 case 0x8b52: 611 return "FLOAT_VEC4" 612 case 0x8b53: 613 return "INT_VEC2" 614 case 0x8b54: 615 return "INT_VEC3" 616 case 0x8b55: 617 return "INT_VEC4" 618 case 0x8b56: 619 return "BOOL" 620 case 0x8b57: 621 return "BOOL_VEC2" 622 case 0x8b58: 623 return "BOOL_VEC3" 624 case 0x8b59: 625 return "BOOL_VEC4" 626 case 0x8b5a: 627 return "FLOAT_MAT2" 628 case 0x8b5b: 629 return "FLOAT_MAT3" 630 case 0x8b5c: 631 return "FLOAT_MAT4" 632 case 0x8b5e: 633 return "SAMPLER_2D" 634 case 0x8b60: 635 return "SAMPLER_CUBE" 636 case 0x8b30: 637 return "FRAGMENT_SHADER" 638 case 0x8b31: 639 return "VERTEX_SHADER" 640 case 0x8a35: 641 return "ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH" 642 case 0x8a36: 643 return "ACTIVE_UNIFORM_BLOCKS" 644 case 0x911a: 645 return "ALREADY_SIGNALED" 646 case 0x8c2f: 647 return "ANY_SAMPLES_PASSED" 648 case 0x8d6a: 649 return "ANY_SAMPLES_PASSED_CONSERVATIVE" 650 case 0x1905: 651 return "BLUE" 652 case 0x911f: 653 return "BUFFER_ACCESS_FLAGS" 654 case 0x9120: 655 return "BUFFER_MAP_LENGTH" 656 case 0x9121: 657 return "BUFFER_MAP_OFFSET" 658 case 0x88bc: 659 return "BUFFER_MAPPED" 660 case 0x88bd: 661 return "BUFFER_MAP_POINTER" 662 case 0x1800: 663 return "COLOR" 664 case 0x8cea: 665 return "COLOR_ATTACHMENT10" 666 case 0x8ce1: 667 return "COLOR_ATTACHMENT1" 668 case 0x8ceb: 669 return "COLOR_ATTACHMENT11" 670 case 0x8cec: 671 return "COLOR_ATTACHMENT12" 672 case 0x8ced: 673 return "COLOR_ATTACHMENT13" 674 case 0x8cee: 675 return "COLOR_ATTACHMENT14" 676 case 0x8cef: 677 return "COLOR_ATTACHMENT15" 678 case 0x8ce2: 679 return "COLOR_ATTACHMENT2" 680 case 0x8ce3: 681 return "COLOR_ATTACHMENT3" 682 case 0x8ce4: 683 return "COLOR_ATTACHMENT4" 684 case 0x8ce5: 685 return "COLOR_ATTACHMENT5" 686 case 0x8ce6: 687 return "COLOR_ATTACHMENT6" 688 case 0x8ce7: 689 return "COLOR_ATTACHMENT7" 690 case 0x8ce8: 691 return "COLOR_ATTACHMENT8" 692 case 0x8ce9: 693 return "COLOR_ATTACHMENT9" 694 case 0x884e: 695 return "COMPARE_REF_TO_TEXTURE" 696 case 0x9270: 697 return "COMPRESSED_R11_EAC" 698 case 0x9272: 699 return "COMPRESSED_RG11_EAC" 700 case 0x9274: 701 return "COMPRESSED_RGB8_ETC2" 702 case 0x9276: 703 return "COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2" 704 case 0x9278: 705 return "COMPRESSED_RGBA8_ETC2_EAC" 706 case 0x9271: 707 return "COMPRESSED_SIGNED_R11_EAC" 708 case 0x9273: 709 return "COMPRESSED_SIGNED_RG11_EAC" 710 case 0x9279: 711 return "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC" 712 case 0x9275: 713 return "COMPRESSED_SRGB8_ETC2" 714 case 0x9277: 715 return "COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2" 716 case 0x911c: 717 return "CONDITION_SATISFIED" 718 case 0x8f36: 719 return "36662" 720 case 0x8f37: 721 return "36663" 722 case 0x8865: 723 return "CURRENT_QUERY" 724 case 0x1801: 725 return "DEPTH" 726 case 0x88f0: 727 return "DEPTH24_STENCIL8" 728 case 0x8cad: 729 return "DEPTH32F_STENCIL8" 730 case 0x81a6: 731 return "DEPTH_COMPONENT24" 732 case 0x8cac: 733 return "DEPTH_COMPONENT32F" 734 case 0x84f9: 735 return "DEPTH_STENCIL" 736 case 0x821a: 737 return "DEPTH_STENCIL_ATTACHMENT" 738 case 0x8825: 739 return "DRAW_BUFFER0" 740 case 0x882f: 741 return "DRAW_BUFFER10" 742 case 0x8826: 743 return "DRAW_BUFFER1" 744 case 0x8830: 745 return "DRAW_BUFFER11" 746 case 0x8831: 747 return "DRAW_BUFFER12" 748 case 0x8832: 749 return "DRAW_BUFFER13" 750 case 0x8833: 751 return "DRAW_BUFFER14" 752 case 0x8834: 753 return "DRAW_BUFFER15" 754 case 0x8827: 755 return "DRAW_BUFFER2" 756 case 0x8828: 757 return "DRAW_BUFFER3" 758 case 0x8829: 759 return "DRAW_BUFFER4" 760 case 0x882a: 761 return "DRAW_BUFFER5" 762 case 0x882b: 763 return "DRAW_BUFFER6" 764 case 0x882c: 765 return "DRAW_BUFFER7" 766 case 0x882d: 767 return "DRAW_BUFFER8" 768 case 0x882e: 769 return "DRAW_BUFFER9" 770 case 0x8ca9: 771 return "DRAW_FRAMEBUFFER" 772 case 0x88ea: 773 return "DYNAMIC_COPY" 774 case 0x88e9: 775 return "DYNAMIC_READ" 776 case 0x8dad: 777 return "FLOAT_32_UNSIGNED_INT_24_8_REV" 778 case 0x8b65: 779 return "FLOAT_MAT2x3" 780 case 0x8b66: 781 return "FLOAT_MAT2x4" 782 case 0x8b67: 783 return "FLOAT_MAT3x2" 784 case 0x8b68: 785 return "FLOAT_MAT3x4" 786 case 0x8b69: 787 return "FLOAT_MAT4x2" 788 case 0x8b6a: 789 return "FLOAT_MAT4x3" 790 case 0x8b8b: 791 return "FRAGMENT_SHADER_DERIVATIVE_HINT" 792 case 0x8215: 793 return "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE" 794 case 0x8214: 795 return "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE" 796 case 0x8210: 797 return "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING" 798 case 0x8211: 799 return "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE" 800 case 0x8216: 801 return "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE" 802 case 0x8213: 803 return "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE" 804 case 0x8212: 805 return "FRAMEBUFFER_ATTACHMENT_RED_SIZE" 806 case 0x8217: 807 return "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE" 808 case 0x8cd4: 809 return "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER" 810 case 0x8218: 811 return "FRAMEBUFFER_DEFAULT" 812 case 0x8d56: 813 return "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE" 814 case 0x8219: 815 return "FRAMEBUFFER_UNDEFINED" 816 case 0x1904: 817 return "GREEN" 818 case 0x140b: 819 return "HALF_FLOAT" 820 case 0x8d9f: 821 return "INT_2_10_10_10_REV" 822 case 0x8c8c: 823 return "INTERLEAVED_ATTRIBS" 824 case 0x8dca: 825 return "INT_SAMPLER_2D" 826 case 0x8dcf: 827 return "INT_SAMPLER_2D_ARRAY" 828 case 0x8dcb: 829 return "INT_SAMPLER_3D" 830 case 0x8dcc: 831 return "INT_SAMPLER_CUBE" 832 case 0xffffffff: 833 return "INVALID_INDEX" 834 case 0x821b: 835 return "MAJOR_VERSION" 836 case 0x10: 837 return "MAP_FLUSH_EXPLICIT_BIT" 838 case 0x8: 839 return "MAP_INVALIDATE_BUFFER_BIT" 840 case 0x20: 841 return "MAP_UNSYNCHRONIZED_BIT" 842 case 0x8008: 843 return "MAX" 844 case 0x8073: 845 return "MAX_3D_TEXTURE_SIZE" 846 case 0x88ff: 847 return "MAX_ARRAY_TEXTURE_LAYERS" 848 case 0x8cdf: 849 return "MAX_COLOR_ATTACHMENTS" 850 case 0x8a33: 851 return "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS" 852 case 0x8a2e: 853 return "MAX_COMBINED_UNIFORM_BLOCKS" 854 case 0x8a31: 855 return "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS" 856 case 0x8824: 857 return "MAX_DRAW_BUFFERS" 858 case 0x8d6b: 859 return "MAX_ELEMENT_INDEX" 860 case 0x80e9: 861 return "MAX_ELEMENTS_INDICES" 862 case 0x80e8: 863 return "MAX_ELEMENTS_VERTICES" 864 case 0x9125: 865 return "MAX_FRAGMENT_INPUT_COMPONENTS" 866 case 0x8a2d: 867 return "MAX_FRAGMENT_UNIFORM_BLOCKS" 868 case 0x8b49: 869 return "MAX_FRAGMENT_UNIFORM_COMPONENTS" 870 case 0x8905: 871 return "MAX_PROGRAM_TEXEL_OFFSET" 872 case 0x8d57: 873 return "MAX_SAMPLES" 874 case 0x9111: 875 return "MAX_SERVER_WAIT_TIMEOUT" 876 case 0x84fd: 877 return "MAX_TEXTURE_LOD_BIAS" 878 case 0x8c8a: 879 return "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS" 880 case 0x8c8b: 881 return "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS" 882 case 0x8c80: 883 return "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS" 884 case 0x8a30: 885 return "MAX_UNIFORM_BLOCK_SIZE" 886 case 0x8a2f: 887 return "MAX_UNIFORM_BUFFER_BINDINGS" 888 case 0x8b4b: 889 return "MAX_VARYING_COMPONENTS" 890 case 0x9122: 891 return "MAX_VERTEX_OUTPUT_COMPONENTS" 892 case 0x8a2b: 893 return "MAX_VERTEX_UNIFORM_BLOCKS" 894 case 0x8b4a: 895 return "MAX_VERTEX_UNIFORM_COMPONENTS" 896 case 0x8007: 897 return "MIN" 898 case 0x821c: 899 return "MINOR_VERSION" 900 case 0x8904: 901 return "MIN_PROGRAM_TEXEL_OFFSET" 902 case 0x821d: 903 return "NUM_EXTENSIONS" 904 case 0x87fe: 905 return "NUM_PROGRAM_BINARY_FORMATS" 906 case 0x9380: 907 return "NUM_SAMPLE_COUNTS" 908 case 0x9112: 909 return "OBJECT_TYPE" 910 case 0xd02: 911 return "PACK_ROW_LENGTH" 912 case 0xd04: 913 return "PACK_SKIP_PIXELS" 914 case 0xd03: 915 return "PACK_SKIP_ROWS" 916 case 0x88eb: 917 return "PIXEL_PACK_BUFFER" 918 case 0x88ed: 919 return "PIXEL_PACK_BUFFER_BINDING" 920 case 0x88ec: 921 return "PIXEL_UNPACK_BUFFER" 922 case 0x88ef: 923 return "PIXEL_UNPACK_BUFFER_BINDING" 924 case 0x8d69: 925 return "PRIMITIVE_RESTART_FIXED_INDEX" 926 case 0x87ff: 927 return "PROGRAM_BINARY_FORMATS" 928 case 0x8741: 929 return "PROGRAM_BINARY_LENGTH" 930 case 0x8257: 931 return "PROGRAM_BINARY_RETRIEVABLE_HINT" 932 case 0x8866: 933 return "QUERY_RESULT" 934 case 0x8867: 935 return "QUERY_RESULT_AVAILABLE" 936 case 0x8c3a: 937 return "R11F_G11F_B10F" 938 case 0x822d: 939 return "R16F" 940 case 0x8233: 941 return "R16I" 942 case 0x8234: 943 return "R16UI" 944 case 0x822e: 945 return "R32F" 946 case 0x8235: 947 return "R32I" 948 case 0x8236: 949 return "R32UI" 950 case 0x8229: 951 return "R8" 952 case 0x8231: 953 return "R8I" 954 case 0x8f94: 955 return "R8_SNORM" 956 case 0x8232: 957 return "R8UI" 958 case 0x8c89: 959 return "RASTERIZER_DISCARD" 960 case 0xc02: 961 return "READ_BUFFER" 962 case 0x8ca8: 963 return "READ_FRAMEBUFFER" 964 case 0x8caa: 965 return "READ_FRAMEBUFFER_BINDING" 966 case 0x1903: 967 return "RED" 968 case 0x8d94: 969 return "RED_INTEGER" 970 case 0x8cab: 971 return "RENDERBUFFER_SAMPLES" 972 case 0x8227: 973 return "RG" 974 case 0x822f: 975 return "RG16F" 976 case 0x8239: 977 return "RG16I" 978 case 0x823a: 979 return "RG16UI" 980 case 0x8230: 981 return "RG32F" 982 case 0x823b: 983 return "RG32I" 984 case 0x823c: 985 return "RG32UI" 986 case 0x822b: 987 return "RG8" 988 case 0x8237: 989 return "RG8I" 990 case 0x8f95: 991 return "RG8_SNORM" 992 case 0x8238: 993 return "RG8UI" 994 case 0x8059: 995 return "RGB10_A2" 996 case 0x906f: 997 return "RGB10_A2UI" 998 case 0x881b: 999 return "RGB16F" 1000 case 0x8d89: 1001 return "RGB16I" 1002 case 0x8d77: 1003 return "RGB16UI" 1004 case 0x8815: 1005 return "RGB32F" 1006 case 0x8d83: 1007 return "RGB32I" 1008 case 0x8d71: 1009 return "RGB32UI" 1010 case 0x8051: 1011 return "RGB8" 1012 case 0x8d8f: 1013 return "RGB8I" 1014 case 0x8f96: 1015 return "RGB8_SNORM" 1016 case 0x8d7d: 1017 return "RGB8UI" 1018 case 0x8c3d: 1019 return "RGB9_E5" 1020 case 0x881a: 1021 return "RGBA16F" 1022 case 0x8d88: 1023 return "RGBA16I" 1024 case 0x8d76: 1025 return "RGBA16UI" 1026 case 0x8814: 1027 return "RGBA32F" 1028 case 0x8d82: 1029 return "RGBA32I" 1030 case 0x8d70: 1031 return "RGBA32UI" 1032 case 0x8058: 1033 return "RGBA8" 1034 case 0x8d8e: 1035 return "RGBA8I" 1036 case 0x8f97: 1037 return "RGBA8_SNORM" 1038 case 0x8d7c: 1039 return "RGBA8UI" 1040 case 0x8d99: 1041 return "RGBA_INTEGER" 1042 case 0x8d98: 1043 return "RGB_INTEGER" 1044 case 0x8228: 1045 return "RG_INTEGER" 1046 case 0x8dc1: 1047 return "SAMPLER_2D_ARRAY" 1048 case 0x8dc4: 1049 return "SAMPLER_2D_ARRAY_SHADOW" 1050 case 0x8b62: 1051 return "SAMPLER_2D_SHADOW" 1052 case 0x8b5f: 1053 return "SAMPLER_3D" 1054 case 0x8919: 1055 return "SAMPLER_BINDING" 1056 case 0x8dc5: 1057 return "SAMPLER_CUBE_SHADOW" 1058 case 0x8c8d: 1059 return "SEPARATE_ATTRIBS" 1060 case 0x9119: 1061 return "SIGNALED" 1062 case 0x8f9c: 1063 return "SIGNED_NORMALIZED" 1064 case 0x8c40: 1065 return "SRGB" 1066 case 0x8c41: 1067 return "SRGB8" 1068 case 0x8c43: 1069 return "SRGB8_ALPHA8" 1070 case 0x88e6: 1071 return "STATIC_COPY" 1072 case 0x88e5: 1073 return "STATIC_READ" 1074 case 0x1802: 1075 return "STENCIL" 1076 case 0x88e2: 1077 return "STREAM_COPY" 1078 case 0x88e1: 1079 return "STREAM_READ" 1080 case 0x9113: 1081 return "SYNC_CONDITION" 1082 case 0x9116: 1083 return "SYNC_FENCE" 1084 case 0x9115: 1085 return "SYNC_FLAGS" 1086 case 0x9117: 1087 return "SYNC_GPU_COMMANDS_COMPLETE" 1088 case 0x9114: 1089 return "SYNC_STATUS" 1090 case 0x8c1a: 1091 return "TEXTURE_2D_ARRAY" 1092 case 0x806f: 1093 return "TEXTURE_3D" 1094 case 0x813c: 1095 return "TEXTURE_BASE_LEVEL" 1096 case 0x8c1d: 1097 return "TEXTURE_BINDING_2D_ARRAY" 1098 case 0x806a: 1099 return "TEXTURE_BINDING_3D" 1100 case 0x884d: 1101 return "TEXTURE_COMPARE_FUNC" 1102 case 0x884c: 1103 return "TEXTURE_COMPARE_MODE" 1104 case 0x912f: 1105 return "TEXTURE_IMMUTABLE_FORMAT" 1106 case 0x82df: 1107 return "TEXTURE_IMMUTABLE_LEVELS" 1108 case 0x813d: 1109 return "TEXTURE_MAX_LEVEL" 1110 case 0x813b: 1111 return "TEXTURE_MAX_LOD" 1112 case 0x813a: 1113 return "TEXTURE_MIN_LOD" 1114 case 0x8e45: 1115 return "TEXTURE_SWIZZLE_A" 1116 case 0x8e44: 1117 return "TEXTURE_SWIZZLE_B" 1118 case 0x8e43: 1119 return "TEXTURE_SWIZZLE_G" 1120 case 0x8e42: 1121 return "TEXTURE_SWIZZLE_R" 1122 case 0x8072: 1123 return "TEXTURE_WRAP_R" 1124 case 0x911b: 1125 return "TIMEOUT_EXPIRED" 1126 case 0x8e22: 1127 return "TRANSFORM_FEEDBACK" 1128 case 0x8e24: 1129 return "TRANSFORM_FEEDBACK_ACTIVE" 1130 case 0x8e25: 1131 return "TRANSFORM_FEEDBACK_BINDING" 1132 case 0x8c8e: 1133 return "TRANSFORM_FEEDBACK_BUFFER" 1134 case 0x8c8f: 1135 return "TRANSFORM_FEEDBACK_BUFFER_BINDING" 1136 case 0x8c7f: 1137 return "TRANSFORM_FEEDBACK_BUFFER_MODE" 1138 case 0x8c85: 1139 return "TRANSFORM_FEEDBACK_BUFFER_SIZE" 1140 case 0x8c84: 1141 return "TRANSFORM_FEEDBACK_BUFFER_START" 1142 case 0x8e23: 1143 return "TRANSFORM_FEEDBACK_PAUSED" 1144 case 0x8c88: 1145 return "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN" 1146 case 0x8c76: 1147 return "TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH" 1148 case 0x8c83: 1149 return "TRANSFORM_FEEDBACK_VARYINGS" 1150 case 0x8a3c: 1151 return "UNIFORM_ARRAY_STRIDE" 1152 case 0x8a43: 1153 return "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES" 1154 case 0x8a42: 1155 return "UNIFORM_BLOCK_ACTIVE_UNIFORMS" 1156 case 0x8a3f: 1157 return "UNIFORM_BLOCK_BINDING" 1158 case 0x8a40: 1159 return "UNIFORM_BLOCK_DATA_SIZE" 1160 case 0x8a3a: 1161 return "UNIFORM_BLOCK_INDEX" 1162 case 0x8a41: 1163 return "UNIFORM_BLOCK_NAME_LENGTH" 1164 case 0x8a46: 1165 return "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER" 1166 case 0x8a44: 1167 return "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER" 1168 case 0x8a11: 1169 return "UNIFORM_BUFFER" 1170 case 0x8a28: 1171 return "UNIFORM_BUFFER_BINDING" 1172 case 0x8a34: 1173 return "UNIFORM_BUFFER_OFFSET_ALIGNMENT" 1174 case 0x8a2a: 1175 return "UNIFORM_BUFFER_SIZE" 1176 case 0x8a29: 1177 return "UNIFORM_BUFFER_START" 1178 case 0x8a3e: 1179 return "UNIFORM_IS_ROW_MAJOR" 1180 case 0x8a3d: 1181 return "UNIFORM_MATRIX_STRIDE" 1182 case 0x8a39: 1183 return "UNIFORM_NAME_LENGTH" 1184 case 0x8a3b: 1185 return "UNIFORM_OFFSET" 1186 case 0x8a38: 1187 return "UNIFORM_SIZE" 1188 case 0x8a37: 1189 return "UNIFORM_TYPE" 1190 case 0x806e: 1191 return "UNPACK_IMAGE_HEIGHT" 1192 case 0xcf2: 1193 return "UNPACK_ROW_LENGTH" 1194 case 0x806d: 1195 return "UNPACK_SKIP_IMAGES" 1196 case 0xcf4: 1197 return "UNPACK_SKIP_PIXELS" 1198 case 0xcf3: 1199 return "UNPACK_SKIP_ROWS" 1200 case 0x9118: 1201 return "UNSIGNALED" 1202 case 0x8c3b: 1203 return "UNSIGNED_INT_10F_11F_11F_REV" 1204 case 0x8368: 1205 return "UNSIGNED_INT_2_10_10_10_REV" 1206 case 0x84fa: 1207 return "UNSIGNED_INT_24_8" 1208 case 0x8c3e: 1209 return "UNSIGNED_INT_5_9_9_9_REV" 1210 case 0x8dd2: 1211 return "UNSIGNED_INT_SAMPLER_2D" 1212 case 0x8dd7: 1213 return "UNSIGNED_INT_SAMPLER_2D_ARRAY" 1214 case 0x8dd3: 1215 return "UNSIGNED_INT_SAMPLER_3D" 1216 case 0x8dd4: 1217 return "UNSIGNED_INT_SAMPLER_CUBE" 1218 case 0x8dc6: 1219 return "UNSIGNED_INT_VEC2" 1220 case 0x8dc7: 1221 return "UNSIGNED_INT_VEC3" 1222 case 0x8dc8: 1223 return "UNSIGNED_INT_VEC4" 1224 case 0x8c17: 1225 return "UNSIGNED_NORMALIZED" 1226 case 0x85b5: 1227 return "VERTEX_ARRAY_BINDING" 1228 case 0x88fe: 1229 return "VERTEX_ATTRIB_ARRAY_DIVISOR" 1230 case 0x88fd: 1231 return "VERTEX_ATTRIB_ARRAY_INTEGER" 1232 case 0x911d: 1233 return "WAIT_FAILED" 1234 default: 1235 return fmt.Sprintf("gl.Enum(0x%x)", uint32(v)) 1236 } 1237 } 1238 1239 func (ctx *context) ActiveTexture(texture Enum) { 1240 defer func() { 1241 errstr := ctx.errDrain() 1242 log.Printf("gl.ActiveTexture(%v) %v", texture, errstr) 1243 }() 1244 ctx.enqueueDebug(call{ 1245 args: fnargs{ 1246 fn: glfnActiveTexture, 1247 a0: texture.c(), 1248 }, 1249 blocking: true}) 1250 } 1251 1252 func (ctx *context) AttachShader(p Program, s Shader) { 1253 defer func() { 1254 errstr := ctx.errDrain() 1255 log.Printf("gl.AttachShader(%v, %v) %v", p, s, errstr) 1256 }() 1257 ctx.enqueueDebug(call{ 1258 args: fnargs{ 1259 fn: glfnAttachShader, 1260 a0: p.c(), 1261 a1: s.c(), 1262 }, 1263 blocking: true}) 1264 } 1265 1266 func (ctx *context) BindAttribLocation(p Program, a Attrib, name string) { 1267 defer func() { 1268 errstr := ctx.errDrain() 1269 log.Printf("gl.BindAttribLocation(%v, %v, %v) %v", p, a, name, errstr) 1270 }() 1271 s, free := ctx.cString(name) 1272 defer free() 1273 ctx.enqueueDebug(call{ 1274 args: fnargs{ 1275 fn: glfnBindAttribLocation, 1276 a0: p.c(), 1277 a1: a.c(), 1278 a2: s, 1279 }, 1280 blocking: true, 1281 }) 1282 } 1283 1284 func (ctx *context) BindBuffer(target Enum, b Buffer) { 1285 defer func() { 1286 errstr := ctx.errDrain() 1287 log.Printf("gl.BindBuffer(%v, %v) %v", target, b, errstr) 1288 }() 1289 ctx.enqueueDebug(call{ 1290 args: fnargs{ 1291 fn: glfnBindBuffer, 1292 a0: target.c(), 1293 a1: b.c(), 1294 }, 1295 blocking: true}) 1296 } 1297 1298 func (ctx *context) BindFramebuffer(target Enum, fb Framebuffer) { 1299 defer func() { 1300 errstr := ctx.errDrain() 1301 log.Printf("gl.BindFramebuffer(%v, %v) %v", target, fb, errstr) 1302 }() 1303 ctx.enqueueDebug(call{ 1304 args: fnargs{ 1305 fn: glfnBindFramebuffer, 1306 a0: target.c(), 1307 a1: fb.c(), 1308 }, 1309 blocking: true}) 1310 } 1311 1312 func (ctx *context) BindRenderbuffer(target Enum, rb Renderbuffer) { 1313 defer func() { 1314 errstr := ctx.errDrain() 1315 log.Printf("gl.BindRenderbuffer(%v, %v) %v", target, rb, errstr) 1316 }() 1317 ctx.enqueueDebug(call{ 1318 args: fnargs{ 1319 fn: glfnBindRenderbuffer, 1320 a0: target.c(), 1321 a1: rb.c(), 1322 }, 1323 blocking: true}) 1324 } 1325 1326 func (ctx *context) BindTexture(target Enum, t Texture) { 1327 defer func() { 1328 errstr := ctx.errDrain() 1329 log.Printf("gl.BindTexture(%v, %v) %v", target, t, errstr) 1330 }() 1331 ctx.enqueueDebug(call{ 1332 args: fnargs{ 1333 fn: glfnBindTexture, 1334 a0: target.c(), 1335 a1: t.c(), 1336 }, 1337 blocking: true}) 1338 } 1339 1340 func (ctx *context) BindVertexArray(va VertexArray) { 1341 defer func() { 1342 errstr := ctx.errDrain() 1343 log.Printf("gl.BindVertexArray(%v) %v", va, errstr) 1344 }() 1345 ctx.enqueueDebug(call{ 1346 args: fnargs{ 1347 fn: glfnBindVertexArray, 1348 a0: va.c(), 1349 }, 1350 blocking: true}) 1351 } 1352 1353 func (ctx *context) BlendColor(red, green, blue, alpha float32) { 1354 defer func() { 1355 errstr := ctx.errDrain() 1356 log.Printf("gl.BlendColor(%v, %v, %v, %v) %v", red, green, blue, alpha, errstr) 1357 }() 1358 ctx.enqueueDebug(call{ 1359 args: fnargs{ 1360 fn: glfnBlendColor, 1361 a0: uintptr(math.Float32bits(red)), 1362 a1: uintptr(math.Float32bits(green)), 1363 a2: uintptr(math.Float32bits(blue)), 1364 a3: uintptr(math.Float32bits(alpha)), 1365 }, 1366 blocking: true}) 1367 } 1368 1369 func (ctx *context) BlendEquation(mode Enum) { 1370 defer func() { 1371 errstr := ctx.errDrain() 1372 log.Printf("gl.BlendEquation(%v) %v", mode, errstr) 1373 }() 1374 ctx.enqueueDebug(call{ 1375 args: fnargs{ 1376 fn: glfnBlendEquation, 1377 a0: mode.c(), 1378 }, 1379 blocking: true}) 1380 } 1381 1382 func (ctx *context) BlendEquationSeparate(modeRGB, modeAlpha Enum) { 1383 defer func() { 1384 errstr := ctx.errDrain() 1385 log.Printf("gl.BlendEquationSeparate(%v, %v) %v", modeRGB, modeAlpha, errstr) 1386 }() 1387 ctx.enqueueDebug(call{ 1388 args: fnargs{ 1389 fn: glfnBlendEquationSeparate, 1390 a0: modeRGB.c(), 1391 a1: modeAlpha.c(), 1392 }, 1393 blocking: true}) 1394 } 1395 1396 func (ctx *context) BlendFunc(sfactor, dfactor Enum) { 1397 defer func() { 1398 errstr := ctx.errDrain() 1399 log.Printf("gl.BlendFunc(%v, %v) %v", sfactor, dfactor, errstr) 1400 }() 1401 ctx.enqueueDebug(call{ 1402 args: fnargs{ 1403 fn: glfnBlendFunc, 1404 a0: sfactor.c(), 1405 a1: dfactor.c(), 1406 }, 1407 blocking: true}) 1408 } 1409 1410 func (ctx *context) BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha Enum) { 1411 defer func() { 1412 errstr := ctx.errDrain() 1413 log.Printf("gl.BlendFuncSeparate(%v, %v, %v, %v) %v", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha, errstr) 1414 }() 1415 ctx.enqueueDebug(call{ 1416 args: fnargs{ 1417 fn: glfnBlendFuncSeparate, 1418 a0: sfactorRGB.c(), 1419 a1: dfactorRGB.c(), 1420 a2: sfactorAlpha.c(), 1421 a3: dfactorAlpha.c(), 1422 }, 1423 blocking: true}) 1424 } 1425 1426 func (ctx *context) BufferData(target Enum, src []byte, usage Enum) { 1427 defer func() { 1428 errstr := ctx.errDrain() 1429 log.Printf("gl.BufferData(%v, len(%d), %v) %v", target, len(src), usage, errstr) 1430 }() 1431 parg := unsafe.Pointer(nil) 1432 if len(src) > 0 { 1433 parg = unsafe.Pointer(&src[0]) 1434 } 1435 ctx.enqueueDebug(call{ 1436 args: fnargs{ 1437 fn: glfnBufferData, 1438 a0: target.c(), 1439 a1: uintptr(len(src)), 1440 a2: usage.c(), 1441 }, 1442 parg: parg, 1443 blocking: true, 1444 }) 1445 } 1446 1447 func (ctx *context) BufferInit(target Enum, size int, usage Enum) { 1448 defer func() { 1449 errstr := ctx.errDrain() 1450 log.Printf("gl.BufferInit(%v, %v, %v) %v", target, size, usage, errstr) 1451 }() 1452 ctx.enqueueDebug(call{ 1453 args: fnargs{ 1454 fn: glfnBufferData, 1455 a0: target.c(), 1456 a1: uintptr(size), 1457 a2: usage.c(), 1458 }, 1459 parg: unsafe.Pointer(nil), 1460 blocking: true}) 1461 } 1462 1463 func (ctx *context) BufferSubData(target Enum, offset int, data []byte) { 1464 defer func() { 1465 errstr := ctx.errDrain() 1466 log.Printf("gl.BufferSubData(%v, %v, len(%d)) %v", target, offset, len(data), errstr) 1467 }() 1468 ctx.enqueueDebug(call{ 1469 args: fnargs{ 1470 fn: glfnBufferSubData, 1471 a0: target.c(), 1472 a1: uintptr(offset), 1473 a2: uintptr(len(data)), 1474 }, 1475 parg: unsafe.Pointer(&data[0]), 1476 blocking: true, 1477 }) 1478 } 1479 1480 func (ctx *context) CheckFramebufferStatus(target Enum) (r0 Enum) { 1481 defer func() { 1482 errstr := ctx.errDrain() 1483 log.Printf("gl.CheckFramebufferStatus(%v) %v%v", target, r0, errstr) 1484 }() 1485 return Enum(ctx.enqueue(call{ 1486 args: fnargs{ 1487 fn: glfnCheckFramebufferStatus, 1488 a0: target.c(), 1489 }, 1490 blocking: true, 1491 })) 1492 } 1493 1494 func (ctx *context) Clear(mask Enum) { 1495 defer func() { 1496 errstr := ctx.errDrain() 1497 log.Printf("gl.Clear(%v) %v", mask, errstr) 1498 }() 1499 ctx.enqueueDebug(call{ 1500 args: fnargs{ 1501 fn: glfnClear, 1502 a0: uintptr(mask), 1503 }, 1504 blocking: true}) 1505 } 1506 1507 func (ctx *context) ClearColor(red, green, blue, alpha float32) { 1508 defer func() { 1509 errstr := ctx.errDrain() 1510 log.Printf("gl.ClearColor(%v, %v, %v, %v) %v", red, green, blue, alpha, errstr) 1511 }() 1512 ctx.enqueueDebug(call{ 1513 args: fnargs{ 1514 fn: glfnClearColor, 1515 a0: uintptr(math.Float32bits(red)), 1516 a1: uintptr(math.Float32bits(green)), 1517 a2: uintptr(math.Float32bits(blue)), 1518 a3: uintptr(math.Float32bits(alpha)), 1519 }, 1520 blocking: true}) 1521 } 1522 1523 func (ctx *context) ClearDepthf(d float32) { 1524 defer func() { 1525 errstr := ctx.errDrain() 1526 log.Printf("gl.ClearDepthf(%v) %v", d, errstr) 1527 }() 1528 ctx.enqueueDebug(call{ 1529 args: fnargs{ 1530 fn: glfnClearDepthf, 1531 a0: uintptr(math.Float32bits(d)), 1532 }, 1533 blocking: true}) 1534 } 1535 1536 func (ctx *context) ClearStencil(s int) { 1537 defer func() { 1538 errstr := ctx.errDrain() 1539 log.Printf("gl.ClearStencil(%v) %v", s, errstr) 1540 }() 1541 ctx.enqueueDebug(call{ 1542 args: fnargs{ 1543 fn: glfnClearStencil, 1544 a0: uintptr(s), 1545 }, 1546 blocking: true}) 1547 } 1548 1549 func (ctx *context) ColorMask(red, green, blue, alpha bool) { 1550 defer func() { 1551 errstr := ctx.errDrain() 1552 log.Printf("gl.ColorMask(%v, %v, %v, %v) %v", red, green, blue, alpha, errstr) 1553 }() 1554 ctx.enqueueDebug(call{ 1555 args: fnargs{ 1556 fn: glfnColorMask, 1557 a0: glBoolean(red), 1558 a1: glBoolean(green), 1559 a2: glBoolean(blue), 1560 a3: glBoolean(alpha), 1561 }, 1562 blocking: true}) 1563 } 1564 1565 func (ctx *context) CompileShader(s Shader) { 1566 defer func() { 1567 errstr := ctx.errDrain() 1568 log.Printf("gl.CompileShader(%v) %v", s, errstr) 1569 }() 1570 ctx.enqueueDebug(call{ 1571 args: fnargs{ 1572 fn: glfnCompileShader, 1573 a0: s.c(), 1574 }, 1575 blocking: true}) 1576 } 1577 1578 func (ctx *context) CompressedTexImage2D(target Enum, level int, internalformat Enum, width, height, border int, data []byte) { 1579 defer func() { 1580 errstr := ctx.errDrain() 1581 log.Printf("gl.CompressedTexImage2D(%v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, internalformat, width, height, border, len(data), errstr) 1582 }() 1583 ctx.enqueueDebug(call{ 1584 args: fnargs{ 1585 fn: glfnCompressedTexImage2D, 1586 a0: target.c(), 1587 a1: uintptr(level), 1588 a2: internalformat.c(), 1589 a3: uintptr(width), 1590 a4: uintptr(height), 1591 a5: uintptr(border), 1592 a6: uintptr(len(data)), 1593 }, 1594 parg: unsafe.Pointer(&data[0]), 1595 blocking: true, 1596 }) 1597 } 1598 1599 func (ctx *context) CompressedTexSubImage2D(target Enum, level, xoffset, yoffset, width, height int, format Enum, data []byte) { 1600 defer func() { 1601 errstr := ctx.errDrain() 1602 log.Printf("gl.CompressedTexSubImage2D(%v, %v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, xoffset, yoffset, width, height, format, len(data), errstr) 1603 }() 1604 ctx.enqueueDebug(call{ 1605 args: fnargs{ 1606 fn: glfnCompressedTexSubImage2D, 1607 a0: target.c(), 1608 a1: uintptr(level), 1609 a2: uintptr(xoffset), 1610 a3: uintptr(yoffset), 1611 a4: uintptr(width), 1612 a5: uintptr(height), 1613 a6: format.c(), 1614 a7: uintptr(len(data)), 1615 }, 1616 parg: unsafe.Pointer(&data[0]), 1617 blocking: true, 1618 }) 1619 } 1620 1621 func (ctx *context) CopyTexImage2D(target Enum, level int, internalformat Enum, x, y, width, height, border int) { 1622 defer func() { 1623 errstr := ctx.errDrain() 1624 log.Printf("gl.CopyTexImage2D(%v, %v, %v, %v, %v, %v, %v, %v) %v", target, level, internalformat, x, y, width, height, border, errstr) 1625 }() 1626 ctx.enqueueDebug(call{ 1627 args: fnargs{ 1628 fn: glfnCopyTexImage2D, 1629 a0: target.c(), 1630 a1: uintptr(level), 1631 a2: internalformat.c(), 1632 a3: uintptr(x), 1633 a4: uintptr(y), 1634 a5: uintptr(width), 1635 a6: uintptr(height), 1636 a7: uintptr(border), 1637 }, 1638 blocking: true}) 1639 } 1640 1641 func (ctx *context) CopyTexSubImage2D(target Enum, level, xoffset, yoffset, x, y, width, height int) { 1642 defer func() { 1643 errstr := ctx.errDrain() 1644 log.Printf("gl.CopyTexSubImage2D(%v, %v, %v, %v, %v, %v, %v, %v) %v", target, level, xoffset, yoffset, x, y, width, height, errstr) 1645 }() 1646 ctx.enqueueDebug(call{ 1647 args: fnargs{ 1648 fn: glfnCopyTexSubImage2D, 1649 a0: target.c(), 1650 a1: uintptr(level), 1651 a2: uintptr(xoffset), 1652 a3: uintptr(yoffset), 1653 a4: uintptr(x), 1654 a5: uintptr(y), 1655 a6: uintptr(width), 1656 a7: uintptr(height), 1657 }, 1658 blocking: true}) 1659 } 1660 1661 func (ctx *context) CreateBuffer() (r0 Buffer) { 1662 defer func() { 1663 errstr := ctx.errDrain() 1664 log.Printf("gl.CreateBuffer() %v%v", r0, errstr) 1665 }() 1666 return Buffer{Value: uint32(ctx.enqueue(call{ 1667 args: fnargs{ 1668 fn: glfnGenBuffer, 1669 }, 1670 blocking: true, 1671 }))} 1672 } 1673 1674 func (ctx *context) CreateFramebuffer() (r0 Framebuffer) { 1675 defer func() { 1676 errstr := ctx.errDrain() 1677 log.Printf("gl.CreateFramebuffer() %v%v", r0, errstr) 1678 }() 1679 return Framebuffer{Value: uint32(ctx.enqueue(call{ 1680 args: fnargs{ 1681 fn: glfnGenFramebuffer, 1682 }, 1683 blocking: true, 1684 }))} 1685 } 1686 1687 func (ctx *context) CreateProgram() (r0 Program) { 1688 defer func() { 1689 errstr := ctx.errDrain() 1690 log.Printf("gl.CreateProgram() %v%v", r0, errstr) 1691 }() 1692 return Program{ 1693 Init: true, 1694 Value: uint32(ctx.enqueue(call{ 1695 args: fnargs{ 1696 fn: glfnCreateProgram, 1697 }, 1698 blocking: true, 1699 }, 1700 ))} 1701 } 1702 1703 func (ctx *context) CreateRenderbuffer() (r0 Renderbuffer) { 1704 defer func() { 1705 errstr := ctx.errDrain() 1706 log.Printf("gl.CreateRenderbuffer() %v%v", r0, errstr) 1707 }() 1708 return Renderbuffer{Value: uint32(ctx.enqueue(call{ 1709 args: fnargs{ 1710 fn: glfnGenRenderbuffer, 1711 }, 1712 blocking: true, 1713 }))} 1714 } 1715 1716 func (ctx *context) CreateShader(ty Enum) (r0 Shader) { 1717 defer func() { 1718 errstr := ctx.errDrain() 1719 log.Printf("gl.CreateShader(%v) %v%v", ty, r0, errstr) 1720 }() 1721 return Shader{Value: uint32(ctx.enqueue(call{ 1722 args: fnargs{ 1723 fn: glfnCreateShader, 1724 a0: uintptr(ty), 1725 }, 1726 blocking: true, 1727 }))} 1728 } 1729 1730 func (ctx *context) CreateTexture() (r0 Texture) { 1731 defer func() { 1732 errstr := ctx.errDrain() 1733 log.Printf("gl.CreateTexture() %v%v", r0, errstr) 1734 }() 1735 return Texture{Value: uint32(ctx.enqueue(call{ 1736 args: fnargs{ 1737 fn: glfnGenTexture, 1738 }, 1739 blocking: true, 1740 }))} 1741 } 1742 1743 func (ctx *context) CreateVertexArray() (r0 VertexArray) { 1744 defer func() { 1745 errstr := ctx.errDrain() 1746 log.Printf("gl.CreateVertexArray() %v%v", r0, errstr) 1747 }() 1748 return VertexArray{Value: uint32(ctx.enqueue(call{ 1749 args: fnargs{ 1750 fn: glfnGenVertexArray, 1751 }, 1752 blocking: true, 1753 }))} 1754 } 1755 1756 func (ctx *context) CullFace(mode Enum) { 1757 defer func() { 1758 errstr := ctx.errDrain() 1759 log.Printf("gl.CullFace(%v) %v", mode, errstr) 1760 }() 1761 ctx.enqueueDebug(call{ 1762 args: fnargs{ 1763 fn: glfnCullFace, 1764 a0: mode.c(), 1765 }, 1766 blocking: true}) 1767 } 1768 1769 func (ctx *context) DeleteBuffer(v Buffer) { 1770 defer func() { 1771 errstr := ctx.errDrain() 1772 log.Printf("gl.DeleteBuffer(%v) %v", v, errstr) 1773 }() 1774 ctx.enqueueDebug(call{ 1775 args: fnargs{ 1776 fn: glfnDeleteBuffer, 1777 a0: v.c(), 1778 }, 1779 blocking: true}) 1780 } 1781 1782 func (ctx *context) DeleteFramebuffer(v Framebuffer) { 1783 defer func() { 1784 errstr := ctx.errDrain() 1785 log.Printf("gl.DeleteFramebuffer(%v) %v", v, errstr) 1786 }() 1787 ctx.enqueueDebug(call{ 1788 args: fnargs{ 1789 fn: glfnDeleteFramebuffer, 1790 a0: v.c(), 1791 }, 1792 blocking: true}) 1793 } 1794 1795 func (ctx *context) DeleteProgram(p Program) { 1796 defer func() { 1797 errstr := ctx.errDrain() 1798 log.Printf("gl.DeleteProgram(%v) %v", p, errstr) 1799 }() 1800 ctx.enqueueDebug(call{ 1801 args: fnargs{ 1802 fn: glfnDeleteProgram, 1803 a0: p.c(), 1804 }, 1805 blocking: true}) 1806 } 1807 1808 func (ctx *context) DeleteRenderbuffer(v Renderbuffer) { 1809 defer func() { 1810 errstr := ctx.errDrain() 1811 log.Printf("gl.DeleteRenderbuffer(%v) %v", v, errstr) 1812 }() 1813 ctx.enqueueDebug(call{ 1814 args: fnargs{ 1815 fn: glfnDeleteRenderbuffer, 1816 a0: v.c(), 1817 }, 1818 blocking: true}) 1819 } 1820 1821 func (ctx *context) DeleteShader(s Shader) { 1822 defer func() { 1823 errstr := ctx.errDrain() 1824 log.Printf("gl.DeleteShader(%v) %v", s, errstr) 1825 }() 1826 ctx.enqueueDebug(call{ 1827 args: fnargs{ 1828 fn: glfnDeleteShader, 1829 a0: s.c(), 1830 }, 1831 blocking: true}) 1832 } 1833 1834 func (ctx *context) DeleteTexture(v Texture) { 1835 defer func() { 1836 errstr := ctx.errDrain() 1837 log.Printf("gl.DeleteTexture(%v) %v", v, errstr) 1838 }() 1839 ctx.enqueueDebug(call{ 1840 args: fnargs{ 1841 fn: glfnDeleteTexture, 1842 a0: v.c(), 1843 }, 1844 blocking: true}) 1845 } 1846 1847 func (ctx *context) DeleteVertexArray(v VertexArray) { 1848 defer func() { 1849 errstr := ctx.errDrain() 1850 log.Printf("gl.DeleteVertexArray(%v) %v", v, errstr) 1851 }() 1852 ctx.enqueueDebug(call{ 1853 args: fnargs{ 1854 fn: glfnDeleteVertexArray, 1855 a0: v.c(), 1856 }, 1857 blocking: true}) 1858 } 1859 1860 func (ctx *context) DepthFunc(fn Enum) { 1861 defer func() { 1862 errstr := ctx.errDrain() 1863 log.Printf("gl.DepthFunc(%v) %v", fn, errstr) 1864 }() 1865 ctx.enqueueDebug(call{ 1866 args: fnargs{ 1867 fn: glfnDepthFunc, 1868 a0: fn.c(), 1869 }, 1870 blocking: true}) 1871 } 1872 1873 func (ctx *context) DepthMask(flag bool) { 1874 defer func() { 1875 errstr := ctx.errDrain() 1876 log.Printf("gl.DepthMask(%v) %v", flag, errstr) 1877 }() 1878 ctx.enqueueDebug(call{ 1879 args: fnargs{ 1880 fn: glfnDepthMask, 1881 a0: glBoolean(flag), 1882 }, 1883 blocking: true}) 1884 } 1885 1886 func (ctx *context) DepthRangef(n, f float32) { 1887 defer func() { 1888 errstr := ctx.errDrain() 1889 log.Printf("gl.DepthRangef(%v, %v) %v", n, f, errstr) 1890 }() 1891 ctx.enqueueDebug(call{ 1892 args: fnargs{ 1893 fn: glfnDepthRangef, 1894 a0: uintptr(math.Float32bits(n)), 1895 a1: uintptr(math.Float32bits(f)), 1896 }, 1897 blocking: true}) 1898 } 1899 1900 func (ctx *context) DetachShader(p Program, s Shader) { 1901 defer func() { 1902 errstr := ctx.errDrain() 1903 log.Printf("gl.DetachShader(%v, %v) %v", p, s, errstr) 1904 }() 1905 ctx.enqueueDebug(call{ 1906 args: fnargs{ 1907 fn: glfnDetachShader, 1908 a0: p.c(), 1909 a1: s.c(), 1910 }, 1911 blocking: true}) 1912 } 1913 1914 func (ctx *context) Disable(cap Enum) { 1915 defer func() { 1916 errstr := ctx.errDrain() 1917 log.Printf("gl.Disable(%v) %v", cap, errstr) 1918 }() 1919 ctx.enqueueDebug(call{ 1920 args: fnargs{ 1921 fn: glfnDisable, 1922 a0: cap.c(), 1923 }, 1924 blocking: true}) 1925 } 1926 1927 func (ctx *context) DisableVertexAttribArray(a Attrib) { 1928 defer func() { 1929 errstr := ctx.errDrain() 1930 log.Printf("gl.DisableVertexAttribArray(%v) %v", a, errstr) 1931 }() 1932 ctx.enqueueDebug(call{ 1933 args: fnargs{ 1934 fn: glfnDisableVertexAttribArray, 1935 a0: a.c(), 1936 }, 1937 blocking: true}) 1938 } 1939 1940 func (ctx *context) DrawArrays(mode Enum, first, count int) { 1941 defer func() { 1942 errstr := ctx.errDrain() 1943 log.Printf("gl.DrawArrays(%v, %v, %v) %v", mode, first, count, errstr) 1944 }() 1945 ctx.enqueueDebug(call{ 1946 args: fnargs{ 1947 fn: glfnDrawArrays, 1948 a0: mode.c(), 1949 a1: uintptr(first), 1950 a2: uintptr(count), 1951 }, 1952 blocking: true}) 1953 } 1954 1955 func (ctx *context) DrawElements(mode Enum, count int, ty Enum, offset int) { 1956 defer func() { 1957 errstr := ctx.errDrain() 1958 log.Printf("gl.DrawElements(%v, %v, %v, %v) %v", mode, count, ty, offset, errstr) 1959 }() 1960 ctx.enqueueDebug(call{ 1961 args: fnargs{ 1962 fn: glfnDrawElements, 1963 a0: mode.c(), 1964 a1: uintptr(count), 1965 a2: ty.c(), 1966 a3: uintptr(offset), 1967 }, 1968 blocking: true}) 1969 } 1970 1971 func (ctx *context) Enable(cap Enum) { 1972 defer func() { 1973 errstr := ctx.errDrain() 1974 log.Printf("gl.Enable(%v) %v", cap, errstr) 1975 }() 1976 ctx.enqueueDebug(call{ 1977 args: fnargs{ 1978 fn: glfnEnable, 1979 a0: cap.c(), 1980 }, 1981 blocking: true}) 1982 } 1983 1984 func (ctx *context) EnableVertexAttribArray(a Attrib) { 1985 defer func() { 1986 errstr := ctx.errDrain() 1987 log.Printf("gl.EnableVertexAttribArray(%v) %v", a, errstr) 1988 }() 1989 ctx.enqueueDebug(call{ 1990 args: fnargs{ 1991 fn: glfnEnableVertexAttribArray, 1992 a0: a.c(), 1993 }, 1994 blocking: true}) 1995 } 1996 1997 func (ctx *context) Finish() { 1998 defer func() { 1999 errstr := ctx.errDrain() 2000 log.Printf("gl.Finish() %v", errstr) 2001 }() 2002 ctx.enqueueDebug(call{ 2003 args: fnargs{ 2004 fn: glfnFinish, 2005 }, 2006 blocking: true, 2007 }) 2008 } 2009 2010 func (ctx *context) Flush() { 2011 defer func() { 2012 errstr := ctx.errDrain() 2013 log.Printf("gl.Flush() %v", errstr) 2014 }() 2015 ctx.enqueueDebug(call{ 2016 args: fnargs{ 2017 fn: glfnFlush, 2018 }, 2019 blocking: true, 2020 }) 2021 } 2022 2023 func (ctx *context) FramebufferRenderbuffer(target, attachment, rbTarget Enum, rb Renderbuffer) { 2024 defer func() { 2025 errstr := ctx.errDrain() 2026 log.Printf("gl.FramebufferRenderbuffer(%v, %v, %v, %v) %v", target, attachment, rbTarget, rb, errstr) 2027 }() 2028 ctx.enqueueDebug(call{ 2029 args: fnargs{ 2030 fn: glfnFramebufferRenderbuffer, 2031 a0: target.c(), 2032 a1: attachment.c(), 2033 a2: rbTarget.c(), 2034 a3: rb.c(), 2035 }, 2036 blocking: true}) 2037 } 2038 2039 func (ctx *context) FramebufferTexture2D(target, attachment, texTarget Enum, t Texture, level int) { 2040 defer func() { 2041 errstr := ctx.errDrain() 2042 log.Printf("gl.FramebufferTexture2D(%v, %v, %v, %v, %v) %v", target, attachment, texTarget, t, level, errstr) 2043 }() 2044 ctx.enqueueDebug(call{ 2045 args: fnargs{ 2046 fn: glfnFramebufferTexture2D, 2047 a0: target.c(), 2048 a1: attachment.c(), 2049 a2: texTarget.c(), 2050 a3: t.c(), 2051 a4: uintptr(level), 2052 }, 2053 blocking: true}) 2054 } 2055 2056 func (ctx *context) FrontFace(mode Enum) { 2057 defer func() { 2058 errstr := ctx.errDrain() 2059 log.Printf("gl.FrontFace(%v) %v", mode, errstr) 2060 }() 2061 ctx.enqueueDebug(call{ 2062 args: fnargs{ 2063 fn: glfnFrontFace, 2064 a0: mode.c(), 2065 }, 2066 blocking: true}) 2067 } 2068 2069 func (ctx *context) GenerateMipmap(target Enum) { 2070 defer func() { 2071 errstr := ctx.errDrain() 2072 log.Printf("gl.GenerateMipmap(%v) %v", target, errstr) 2073 }() 2074 ctx.enqueueDebug(call{ 2075 args: fnargs{ 2076 fn: glfnGenerateMipmap, 2077 a0: target.c(), 2078 }, 2079 blocking: true}) 2080 } 2081 2082 func (ctx *context) GetActiveAttrib(p Program, index uint32) (name string, size int, ty Enum) { 2083 defer func() { 2084 errstr := ctx.errDrain() 2085 log.Printf("gl.GetActiveAttrib(%v, %v) (%v, %v, %v) %v", p, index, name, size, ty, errstr) 2086 }() 2087 bufSize := ctx.GetProgrami(p, ACTIVE_ATTRIBUTE_MAX_LENGTH) 2088 buf := make([]byte, bufSize) 2089 var cType int 2090 cSize := ctx.enqueue(call{ 2091 args: fnargs{ 2092 fn: glfnGetActiveAttrib, 2093 a0: p.c(), 2094 a1: uintptr(index), 2095 a2: uintptr(bufSize), 2096 a3: uintptr(unsafe.Pointer(&cType)), 2097 }, 2098 parg: unsafe.Pointer(&buf[0]), 2099 blocking: true, 2100 }) 2101 return goString(buf), int(cSize), Enum(cType) 2102 } 2103 2104 func (ctx *context) GetActiveUniform(p Program, index uint32) (name string, size int, ty Enum) { 2105 defer func() { 2106 errstr := ctx.errDrain() 2107 log.Printf("gl.GetActiveUniform(%v, %v) (%v, %v, %v) %v", p, index, name, size, ty, errstr) 2108 }() 2109 bufSize := ctx.GetProgrami(p, ACTIVE_UNIFORM_MAX_LENGTH) 2110 buf := make([]byte, bufSize+8) 2111 var cType int 2112 cSize := ctx.enqueue(call{ 2113 args: fnargs{ 2114 fn: glfnGetActiveUniform, 2115 a0: p.c(), 2116 a1: uintptr(index), 2117 a2: uintptr(bufSize), 2118 a3: uintptr(unsafe.Pointer(&cType)), 2119 }, 2120 parg: unsafe.Pointer(&buf[0]), 2121 blocking: true, 2122 }) 2123 return goString(buf), int(cSize), Enum(cType) 2124 } 2125 2126 func (ctx *context) GetAttachedShaders(p Program) (r0 []Shader) { 2127 defer func() { 2128 errstr := ctx.errDrain() 2129 log.Printf("gl.GetAttachedShaders(%v) %v%v", p, r0, errstr) 2130 }() 2131 shadersLen := ctx.GetProgrami(p, ATTACHED_SHADERS) 2132 if shadersLen == 0 { 2133 return nil 2134 } 2135 buf := make([]uint32, shadersLen) 2136 n := int(ctx.enqueue(call{ 2137 args: fnargs{ 2138 fn: glfnGetAttachedShaders, 2139 a0: p.c(), 2140 a1: uintptr(shadersLen), 2141 }, 2142 parg: unsafe.Pointer(&buf[0]), 2143 blocking: true, 2144 })) 2145 buf = buf[:int(n)] 2146 shaders := make([]Shader, len(buf)) 2147 for i, s := range buf { 2148 shaders[i] = Shader{Value: uint32(s)} 2149 } 2150 return shaders 2151 } 2152 2153 func (ctx *context) GetAttribLocation(p Program, name string) (r0 Attrib) { 2154 defer func() { 2155 errstr := ctx.errDrain() 2156 r0.name = name 2157 log.Printf("gl.GetAttribLocation(%v, %v) %v%v", p, name, r0, errstr) 2158 }() 2159 s, free := ctx.cString(name) 2160 defer free() 2161 return Attrib{Value: uint(ctx.enqueue(call{ 2162 args: fnargs{ 2163 fn: glfnGetAttribLocation, 2164 a0: p.c(), 2165 a1: s, 2166 }, 2167 blocking: true, 2168 }))} 2169 } 2170 2171 func (ctx *context) GetBooleanv(dst []bool, pname Enum) { 2172 defer func() { 2173 errstr := ctx.errDrain() 2174 log.Printf("gl.GetBooleanv(%v, %v) %v", dst, pname, errstr) 2175 }() 2176 buf := make([]int32, len(dst)) 2177 ctx.enqueueDebug(call{ 2178 args: fnargs{ 2179 fn: glfnGetBooleanv, 2180 a0: pname.c(), 2181 }, 2182 parg: unsafe.Pointer(&buf[0]), 2183 blocking: true, 2184 }) 2185 for i, v := range buf { 2186 dst[i] = v != 0 2187 } 2188 } 2189 2190 func (ctx *context) GetFloatv(dst []float32, pname Enum) { 2191 defer func() { 2192 errstr := ctx.errDrain() 2193 log.Printf("gl.GetFloatv(len(%d), %v) %v", len(dst), pname, errstr) 2194 }() 2195 ctx.enqueueDebug(call{ 2196 args: fnargs{ 2197 fn: glfnGetFloatv, 2198 a0: pname.c(), 2199 }, 2200 parg: unsafe.Pointer(&dst[0]), 2201 blocking: true, 2202 }) 2203 } 2204 2205 func (ctx *context) GetIntegerv(dst []int32, pname Enum) { 2206 defer func() { 2207 errstr := ctx.errDrain() 2208 log.Printf("gl.GetIntegerv(%v, %v) %v", dst, pname, errstr) 2209 }() 2210 ctx.enqueueDebug(call{ 2211 args: fnargs{ 2212 fn: glfnGetIntegerv, 2213 a0: pname.c(), 2214 }, 2215 parg: unsafe.Pointer(&dst[0]), 2216 blocking: true, 2217 }) 2218 } 2219 2220 func (ctx *context) GetInteger(pname Enum) (r0 int) { 2221 defer func() { 2222 errstr := ctx.errDrain() 2223 log.Printf("gl.GetInteger(%v) %v%v", pname, r0, errstr) 2224 }() 2225 var v [1]int32 2226 ctx.GetIntegerv(v[:], pname) 2227 return int(v[0]) 2228 } 2229 2230 func (ctx *context) GetBufferParameteri(target, value Enum) (r0 int) { 2231 defer func() { 2232 errstr := ctx.errDrain() 2233 log.Printf("gl.GetBufferParameteri(%v, %v) %v%v", target, value, r0, errstr) 2234 }() 2235 return int(ctx.enqueue(call{ 2236 args: fnargs{ 2237 fn: glfnGetBufferParameteri, 2238 a0: target.c(), 2239 a1: value.c(), 2240 }, 2241 blocking: true, 2242 })) 2243 } 2244 2245 func (ctx *context) GetError() (r0 Enum) { 2246 return Enum(ctx.enqueue(call{ 2247 args: fnargs{ 2248 fn: glfnGetError, 2249 }, 2250 blocking: true, 2251 })) 2252 } 2253 2254 func (ctx *context) GetFramebufferAttachmentParameteri(target, attachment, pname Enum) (r0 int) { 2255 defer func() { 2256 errstr := ctx.errDrain() 2257 log.Printf("gl.GetFramebufferAttachmentParameteri(%v, %v, %v) %v%v", target, attachment, pname, r0, errstr) 2258 }() 2259 return int(ctx.enqueue(call{ 2260 args: fnargs{ 2261 fn: glfnGetFramebufferAttachmentParameteriv, 2262 a0: target.c(), 2263 a1: attachment.c(), 2264 a2: pname.c(), 2265 }, 2266 blocking: true, 2267 })) 2268 } 2269 2270 func (ctx *context) GetProgrami(p Program, pname Enum) (r0 int) { 2271 defer func() { 2272 errstr := ctx.errDrain() 2273 log.Printf("gl.GetProgrami(%v, %v) %v%v", p, pname, r0, errstr) 2274 }() 2275 return int(ctx.enqueue(call{ 2276 args: fnargs{ 2277 fn: glfnGetProgramiv, 2278 a0: p.c(), 2279 a1: pname.c(), 2280 }, 2281 blocking: true, 2282 })) 2283 } 2284 2285 func (ctx *context) GetProgramInfoLog(p Program) (r0 string) { 2286 defer func() { 2287 errstr := ctx.errDrain() 2288 log.Printf("gl.GetProgramInfoLog(%v) %v%v", p, r0, errstr) 2289 }() 2290 infoLen := ctx.GetProgrami(p, INFO_LOG_LENGTH) 2291 if infoLen == 0 { 2292 return "" 2293 } 2294 buf := make([]byte, infoLen) 2295 ctx.enqueueDebug(call{ 2296 args: fnargs{ 2297 fn: glfnGetProgramInfoLog, 2298 a0: p.c(), 2299 a1: uintptr(infoLen), 2300 }, 2301 parg: unsafe.Pointer(&buf[0]), 2302 blocking: true, 2303 }) 2304 return goString(buf) 2305 } 2306 2307 func (ctx *context) GetRenderbufferParameteri(target, pname Enum) (r0 int) { 2308 defer func() { 2309 errstr := ctx.errDrain() 2310 log.Printf("gl.GetRenderbufferParameteri(%v, %v) %v%v", target, pname, r0, errstr) 2311 }() 2312 return int(ctx.enqueue(call{ 2313 args: fnargs{ 2314 fn: glfnGetRenderbufferParameteriv, 2315 a0: target.c(), 2316 a1: pname.c(), 2317 }, 2318 blocking: true, 2319 })) 2320 } 2321 2322 func (ctx *context) GetShaderi(s Shader, pname Enum) (r0 int) { 2323 defer func() { 2324 errstr := ctx.errDrain() 2325 log.Printf("gl.GetShaderi(%v, %v) %v%v", s, pname, r0, errstr) 2326 }() 2327 return int(ctx.enqueue(call{ 2328 args: fnargs{ 2329 fn: glfnGetShaderiv, 2330 a0: s.c(), 2331 a1: pname.c(), 2332 }, 2333 blocking: true, 2334 })) 2335 } 2336 2337 func (ctx *context) GetShaderInfoLog(s Shader) (r0 string) { 2338 defer func() { 2339 errstr := ctx.errDrain() 2340 log.Printf("gl.GetShaderInfoLog(%v) %v%v", s, r0, errstr) 2341 }() 2342 infoLen := ctx.GetShaderi(s, INFO_LOG_LENGTH) 2343 if infoLen == 0 { 2344 return "" 2345 } 2346 buf := make([]byte, infoLen) 2347 ctx.enqueueDebug(call{ 2348 args: fnargs{ 2349 fn: glfnGetShaderInfoLog, 2350 a0: s.c(), 2351 a1: uintptr(infoLen), 2352 }, 2353 parg: unsafe.Pointer(&buf[0]), 2354 blocking: true, 2355 }) 2356 return goString(buf) 2357 } 2358 2359 func (ctx *context) GetShaderPrecisionFormat(shadertype, precisiontype Enum) (rangeLow, rangeHigh, precision int) { 2360 defer func() { 2361 errstr := ctx.errDrain() 2362 log.Printf("gl.GetShaderPrecisionFormat(%v, %v) (%v, %v, %v) %v", shadertype, precisiontype, rangeLow, rangeHigh, precision, errstr) 2363 }() 2364 var rangeAndPrec [3]int32 2365 ctx.enqueueDebug(call{ 2366 args: fnargs{ 2367 fn: glfnGetShaderPrecisionFormat, 2368 a0: shadertype.c(), 2369 a1: precisiontype.c(), 2370 }, 2371 parg: unsafe.Pointer(&rangeAndPrec[0]), 2372 blocking: true, 2373 }) 2374 return int(rangeAndPrec[0]), int(rangeAndPrec[1]), int(rangeAndPrec[2]) 2375 } 2376 2377 func (ctx *context) GetShaderSource(s Shader) (r0 string) { 2378 defer func() { 2379 errstr := ctx.errDrain() 2380 log.Printf("gl.GetShaderSource(%v) %v%v", s, r0, errstr) 2381 }() 2382 sourceLen := ctx.GetShaderi(s, SHADER_SOURCE_LENGTH) 2383 if sourceLen == 0 { 2384 return "" 2385 } 2386 buf := make([]byte, sourceLen) 2387 ctx.enqueueDebug(call{ 2388 args: fnargs{ 2389 fn: glfnGetShaderSource, 2390 a0: s.c(), 2391 a1: uintptr(sourceLen), 2392 }, 2393 parg: unsafe.Pointer(&buf[0]), 2394 blocking: true, 2395 }) 2396 return goString(buf) 2397 } 2398 2399 func (ctx *context) GetString(pname Enum) (r0 string) { 2400 defer func() { 2401 errstr := ctx.errDrain() 2402 log.Printf("gl.GetString(%v) %v%v", pname, r0, errstr) 2403 }() 2404 ret := ctx.enqueue(call{ 2405 args: fnargs{ 2406 fn: glfnGetString, 2407 a0: pname.c(), 2408 }, 2409 blocking: true, 2410 }) 2411 retp := unsafe.Pointer(ret) 2412 buf := (*[1 << 24]byte)(retp)[:] 2413 return goString(buf) 2414 } 2415 2416 func (ctx *context) GetTexParameterfv(dst []float32, target, pname Enum) { 2417 defer func() { 2418 errstr := ctx.errDrain() 2419 log.Printf("gl.GetTexParameterfv(len(%d), %v, %v) %v", len(dst), target, pname, errstr) 2420 }() 2421 ctx.enqueueDebug(call{ 2422 args: fnargs{ 2423 fn: glfnGetTexParameterfv, 2424 a0: target.c(), 2425 a1: pname.c(), 2426 }, 2427 parg: unsafe.Pointer(&dst[0]), 2428 blocking: true, 2429 }) 2430 } 2431 2432 func (ctx *context) GetTexParameteriv(dst []int32, target, pname Enum) { 2433 defer func() { 2434 errstr := ctx.errDrain() 2435 log.Printf("gl.GetTexParameteriv(%v, %v, %v) %v", dst, target, pname, errstr) 2436 }() 2437 ctx.enqueueDebug(call{ 2438 args: fnargs{ 2439 fn: glfnGetTexParameteriv, 2440 a0: target.c(), 2441 a1: pname.c(), 2442 }, 2443 blocking: true, 2444 }) 2445 } 2446 2447 func (ctx *context) GetUniformfv(dst []float32, src Uniform, p Program) { 2448 defer func() { 2449 errstr := ctx.errDrain() 2450 log.Printf("gl.GetUniformfv(len(%d), %v, %v) %v", len(dst), src, p, errstr) 2451 }() 2452 ctx.enqueueDebug(call{ 2453 args: fnargs{ 2454 fn: glfnGetUniformfv, 2455 a0: p.c(), 2456 a1: src.c(), 2457 }, 2458 parg: unsafe.Pointer(&dst[0]), 2459 blocking: true, 2460 }) 2461 } 2462 2463 func (ctx *context) GetUniformiv(dst []int32, src Uniform, p Program) { 2464 defer func() { 2465 errstr := ctx.errDrain() 2466 log.Printf("gl.GetUniformiv(%v, %v, %v) %v", dst, src, p, errstr) 2467 }() 2468 ctx.enqueueDebug(call{ 2469 args: fnargs{ 2470 fn: glfnGetUniformiv, 2471 a0: p.c(), 2472 a1: src.c(), 2473 }, 2474 parg: unsafe.Pointer(&dst[0]), 2475 blocking: true, 2476 }) 2477 } 2478 2479 func (ctx *context) GetUniformLocation(p Program, name string) (r0 Uniform) { 2480 defer func() { 2481 errstr := ctx.errDrain() 2482 r0.name = name 2483 log.Printf("gl.GetUniformLocation(%v, %v) %v%v", p, name, r0, errstr) 2484 }() 2485 s, free := ctx.cString(name) 2486 defer free() 2487 return Uniform{Value: int32(ctx.enqueue(call{ 2488 args: fnargs{ 2489 fn: glfnGetUniformLocation, 2490 a0: p.c(), 2491 a1: s, 2492 }, 2493 blocking: true, 2494 }))} 2495 } 2496 2497 func (ctx *context) GetVertexAttribf(src Attrib, pname Enum) (r0 float32) { 2498 defer func() { 2499 errstr := ctx.errDrain() 2500 log.Printf("gl.GetVertexAttribf(%v, %v) %v%v", src, pname, r0, errstr) 2501 }() 2502 var params [1]float32 2503 ctx.GetVertexAttribfv(params[:], src, pname) 2504 return params[0] 2505 } 2506 2507 func (ctx *context) GetVertexAttribfv(dst []float32, src Attrib, pname Enum) { 2508 defer func() { 2509 errstr := ctx.errDrain() 2510 log.Printf("gl.GetVertexAttribfv(len(%d), %v, %v) %v", len(dst), src, pname, errstr) 2511 }() 2512 ctx.enqueueDebug(call{ 2513 args: fnargs{ 2514 fn: glfnGetVertexAttribfv, 2515 a0: src.c(), 2516 a1: pname.c(), 2517 }, 2518 parg: unsafe.Pointer(&dst[0]), 2519 blocking: true, 2520 }) 2521 } 2522 2523 func (ctx *context) GetVertexAttribi(src Attrib, pname Enum) (r0 int32) { 2524 defer func() { 2525 errstr := ctx.errDrain() 2526 log.Printf("gl.GetVertexAttribi(%v, %v) %v%v", src, pname, r0, errstr) 2527 }() 2528 var params [1]int32 2529 ctx.GetVertexAttribiv(params[:], src, pname) 2530 return params[0] 2531 } 2532 2533 func (ctx *context) GetVertexAttribiv(dst []int32, src Attrib, pname Enum) { 2534 defer func() { 2535 errstr := ctx.errDrain() 2536 log.Printf("gl.GetVertexAttribiv(%v, %v, %v) %v", dst, src, pname, errstr) 2537 }() 2538 ctx.enqueueDebug(call{ 2539 args: fnargs{ 2540 fn: glfnGetVertexAttribiv, 2541 a0: src.c(), 2542 a1: pname.c(), 2543 }, 2544 parg: unsafe.Pointer(&dst[0]), 2545 blocking: true, 2546 }) 2547 } 2548 2549 func (ctx *context) Hint(target, mode Enum) { 2550 defer func() { 2551 errstr := ctx.errDrain() 2552 log.Printf("gl.Hint(%v, %v) %v", target, mode, errstr) 2553 }() 2554 ctx.enqueueDebug(call{ 2555 args: fnargs{ 2556 fn: glfnHint, 2557 a0: target.c(), 2558 a1: mode.c(), 2559 }, 2560 blocking: true}) 2561 } 2562 2563 func (ctx *context) IsBuffer(b Buffer) (r0 bool) { 2564 defer func() { 2565 errstr := ctx.errDrain() 2566 log.Printf("gl.IsBuffer(%v) %v%v", b, r0, errstr) 2567 }() 2568 return 0 != ctx.enqueue(call{ 2569 args: fnargs{ 2570 fn: glfnIsBuffer, 2571 a0: b.c(), 2572 }, 2573 blocking: true, 2574 }) 2575 } 2576 2577 func (ctx *context) IsEnabled(cap Enum) (r0 bool) { 2578 defer func() { 2579 errstr := ctx.errDrain() 2580 log.Printf("gl.IsEnabled(%v) %v%v", cap, r0, errstr) 2581 }() 2582 return 0 != ctx.enqueue(call{ 2583 args: fnargs{ 2584 fn: glfnIsEnabled, 2585 a0: cap.c(), 2586 }, 2587 blocking: true, 2588 }) 2589 } 2590 2591 func (ctx *context) IsFramebuffer(fb Framebuffer) (r0 bool) { 2592 defer func() { 2593 errstr := ctx.errDrain() 2594 log.Printf("gl.IsFramebuffer(%v) %v%v", fb, r0, errstr) 2595 }() 2596 return 0 != ctx.enqueue(call{ 2597 args: fnargs{ 2598 fn: glfnIsFramebuffer, 2599 a0: fb.c(), 2600 }, 2601 blocking: true, 2602 }) 2603 } 2604 2605 func (ctx *context) IsProgram(p Program) (r0 bool) { 2606 defer func() { 2607 errstr := ctx.errDrain() 2608 log.Printf("gl.IsProgram(%v) %v%v", p, r0, errstr) 2609 }() 2610 return 0 != ctx.enqueue(call{ 2611 args: fnargs{ 2612 fn: glfnIsProgram, 2613 a0: p.c(), 2614 }, 2615 blocking: true, 2616 }) 2617 } 2618 2619 func (ctx *context) IsRenderbuffer(rb Renderbuffer) (r0 bool) { 2620 defer func() { 2621 errstr := ctx.errDrain() 2622 log.Printf("gl.IsRenderbuffer(%v) %v%v", rb, r0, errstr) 2623 }() 2624 return 0 != ctx.enqueue(call{ 2625 args: fnargs{ 2626 fn: glfnIsRenderbuffer, 2627 a0: rb.c(), 2628 }, 2629 blocking: true, 2630 }) 2631 } 2632 2633 func (ctx *context) IsShader(s Shader) (r0 bool) { 2634 defer func() { 2635 errstr := ctx.errDrain() 2636 log.Printf("gl.IsShader(%v) %v%v", s, r0, errstr) 2637 }() 2638 return 0 != ctx.enqueue(call{ 2639 args: fnargs{ 2640 fn: glfnIsShader, 2641 a0: s.c(), 2642 }, 2643 blocking: true, 2644 }) 2645 } 2646 2647 func (ctx *context) IsTexture(t Texture) (r0 bool) { 2648 defer func() { 2649 errstr := ctx.errDrain() 2650 log.Printf("gl.IsTexture(%v) %v%v", t, r0, errstr) 2651 }() 2652 return 0 != ctx.enqueue(call{ 2653 args: fnargs{ 2654 fn: glfnIsTexture, 2655 a0: t.c(), 2656 }, 2657 blocking: true, 2658 }) 2659 } 2660 2661 func (ctx *context) LineWidth(width float32) { 2662 defer func() { 2663 errstr := ctx.errDrain() 2664 log.Printf("gl.LineWidth(%v) %v", width, errstr) 2665 }() 2666 ctx.enqueueDebug(call{ 2667 args: fnargs{ 2668 fn: glfnLineWidth, 2669 a0: uintptr(math.Float32bits(width)), 2670 }, 2671 blocking: true}) 2672 } 2673 2674 func (ctx *context) LinkProgram(p Program) { 2675 defer func() { 2676 errstr := ctx.errDrain() 2677 log.Printf("gl.LinkProgram(%v) %v", p, errstr) 2678 }() 2679 ctx.enqueueDebug(call{ 2680 args: fnargs{ 2681 fn: glfnLinkProgram, 2682 a0: p.c(), 2683 }, 2684 blocking: true}) 2685 } 2686 2687 func (ctx *context) PixelStorei(pname Enum, param int32) { 2688 defer func() { 2689 errstr := ctx.errDrain() 2690 log.Printf("gl.PixelStorei(%v, %v) %v", pname, param, errstr) 2691 }() 2692 ctx.enqueueDebug(call{ 2693 args: fnargs{ 2694 fn: glfnPixelStorei, 2695 a0: pname.c(), 2696 a1: uintptr(param), 2697 }, 2698 blocking: true}) 2699 } 2700 2701 func (ctx *context) PolygonOffset(factor, units float32) { 2702 defer func() { 2703 errstr := ctx.errDrain() 2704 log.Printf("gl.PolygonOffset(%v, %v) %v", factor, units, errstr) 2705 }() 2706 ctx.enqueueDebug(call{ 2707 args: fnargs{ 2708 fn: glfnPolygonOffset, 2709 a0: uintptr(math.Float32bits(factor)), 2710 a1: uintptr(math.Float32bits(units)), 2711 }, 2712 blocking: true}) 2713 } 2714 2715 func (ctx *context) ReadPixels(dst []byte, x, y, width, height int, format, ty Enum) { 2716 defer func() { 2717 errstr := ctx.errDrain() 2718 log.Printf("gl.ReadPixels(len(%d), %v, %v, %v, %v, %v, %v) %v", len(dst), x, y, width, height, format, ty, errstr) 2719 }() 2720 ctx.enqueueDebug(call{ 2721 args: fnargs{ 2722 fn: glfnReadPixels, 2723 2724 a0: uintptr(x), 2725 a1: uintptr(y), 2726 a2: uintptr(width), 2727 a3: uintptr(height), 2728 a4: format.c(), 2729 a5: ty.c(), 2730 }, 2731 parg: unsafe.Pointer(&dst[0]), 2732 blocking: true, 2733 }) 2734 } 2735 2736 func (ctx *context) ReleaseShaderCompiler() { 2737 defer func() { 2738 errstr := ctx.errDrain() 2739 log.Printf("gl.ReleaseShaderCompiler() %v", errstr) 2740 }() 2741 ctx.enqueueDebug(call{ 2742 args: fnargs{ 2743 fn: glfnReleaseShaderCompiler, 2744 }, 2745 blocking: true}) 2746 } 2747 2748 func (ctx *context) RenderbufferStorage(target, internalFormat Enum, width, height int) { 2749 defer func() { 2750 errstr := ctx.errDrain() 2751 log.Printf("gl.RenderbufferStorage(%v, %v, %v, %v) %v", target, internalFormat, width, height, errstr) 2752 }() 2753 ctx.enqueueDebug(call{ 2754 args: fnargs{ 2755 fn: glfnRenderbufferStorage, 2756 a0: target.c(), 2757 a1: internalFormat.c(), 2758 a2: uintptr(width), 2759 a3: uintptr(height), 2760 }, 2761 blocking: true}) 2762 } 2763 2764 func (ctx *context) SampleCoverage(value float32, invert bool) { 2765 defer func() { 2766 errstr := ctx.errDrain() 2767 log.Printf("gl.SampleCoverage(%v, %v) %v", value, invert, errstr) 2768 }() 2769 ctx.enqueueDebug(call{ 2770 args: fnargs{ 2771 fn: glfnSampleCoverage, 2772 a0: uintptr(math.Float32bits(value)), 2773 a1: glBoolean(invert), 2774 }, 2775 blocking: true}) 2776 } 2777 2778 func (ctx *context) Scissor(x, y, width, height int32) { 2779 defer func() { 2780 errstr := ctx.errDrain() 2781 log.Printf("gl.Scissor(%v, %v, %v, %v) %v", x, y, width, height, errstr) 2782 }() 2783 ctx.enqueueDebug(call{ 2784 args: fnargs{ 2785 fn: glfnScissor, 2786 a0: uintptr(x), 2787 a1: uintptr(y), 2788 a2: uintptr(width), 2789 a3: uintptr(height), 2790 }, 2791 blocking: true}) 2792 } 2793 2794 func (ctx *context) ShaderSource(s Shader, src string) { 2795 defer func() { 2796 errstr := ctx.errDrain() 2797 log.Printf("gl.ShaderSource(%v, %v) %v", s, src, errstr) 2798 }() 2799 strp, free := ctx.cStringPtr(src) 2800 defer free() 2801 ctx.enqueueDebug(call{ 2802 args: fnargs{ 2803 fn: glfnShaderSource, 2804 a0: s.c(), 2805 a1: 1, 2806 a2: strp, 2807 }, 2808 blocking: true, 2809 }) 2810 } 2811 2812 func (ctx *context) StencilFunc(fn Enum, ref int, mask uint32) { 2813 defer func() { 2814 errstr := ctx.errDrain() 2815 log.Printf("gl.StencilFunc(%v, %v, %v) %v", fn, ref, mask, errstr) 2816 }() 2817 ctx.enqueueDebug(call{ 2818 args: fnargs{ 2819 fn: glfnStencilFunc, 2820 a0: fn.c(), 2821 a1: uintptr(ref), 2822 a2: uintptr(mask), 2823 }, 2824 blocking: true}) 2825 } 2826 2827 func (ctx *context) StencilFuncSeparate(face, fn Enum, ref int, mask uint32) { 2828 defer func() { 2829 errstr := ctx.errDrain() 2830 log.Printf("gl.StencilFuncSeparate(%v, %v, %v, %v) %v", face, fn, ref, mask, errstr) 2831 }() 2832 ctx.enqueueDebug(call{ 2833 args: fnargs{ 2834 fn: glfnStencilFuncSeparate, 2835 a0: face.c(), 2836 a1: fn.c(), 2837 a2: uintptr(ref), 2838 a3: uintptr(mask), 2839 }, 2840 blocking: true}) 2841 } 2842 2843 func (ctx *context) StencilMask(mask uint32) { 2844 defer func() { 2845 errstr := ctx.errDrain() 2846 log.Printf("gl.StencilMask(%v) %v", mask, errstr) 2847 }() 2848 ctx.enqueueDebug(call{ 2849 args: fnargs{ 2850 fn: glfnStencilMask, 2851 a0: uintptr(mask), 2852 }, 2853 blocking: true}) 2854 } 2855 2856 func (ctx *context) StencilMaskSeparate(face Enum, mask uint32) { 2857 defer func() { 2858 errstr := ctx.errDrain() 2859 log.Printf("gl.StencilMaskSeparate(%v, %v) %v", face, mask, errstr) 2860 }() 2861 ctx.enqueueDebug(call{ 2862 args: fnargs{ 2863 fn: glfnStencilMaskSeparate, 2864 a0: face.c(), 2865 a1: uintptr(mask), 2866 }, 2867 blocking: true}) 2868 } 2869 2870 func (ctx *context) StencilOp(fail, zfail, zpass Enum) { 2871 defer func() { 2872 errstr := ctx.errDrain() 2873 log.Printf("gl.StencilOp(%v, %v, %v) %v", fail, zfail, zpass, errstr) 2874 }() 2875 ctx.enqueueDebug(call{ 2876 args: fnargs{ 2877 fn: glfnStencilOp, 2878 a0: fail.c(), 2879 a1: zfail.c(), 2880 a2: zpass.c(), 2881 }, 2882 blocking: true}) 2883 } 2884 2885 func (ctx *context) StencilOpSeparate(face, sfail, dpfail, dppass Enum) { 2886 defer func() { 2887 errstr := ctx.errDrain() 2888 log.Printf("gl.StencilOpSeparate(%v, %v, %v, %v) %v", face, sfail, dpfail, dppass, errstr) 2889 }() 2890 ctx.enqueueDebug(call{ 2891 args: fnargs{ 2892 fn: glfnStencilOpSeparate, 2893 a0: face.c(), 2894 a1: sfail.c(), 2895 a2: dpfail.c(), 2896 a3: dppass.c(), 2897 }, 2898 blocking: true}) 2899 } 2900 2901 func (ctx *context) TexImage2D(target Enum, level int, internalFormat int, width, height int, format Enum, ty Enum, data []byte) { 2902 defer func() { 2903 errstr := ctx.errDrain() 2904 log.Printf("gl.TexImage2D(%v, %v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, internalFormat, width, height, format, ty, len(data), errstr) 2905 }() 2906 parg := unsafe.Pointer(nil) 2907 if len(data) > 0 { 2908 parg = unsafe.Pointer(&data[0]) 2909 } 2910 ctx.enqueueDebug(call{ 2911 args: fnargs{ 2912 fn: glfnTexImage2D, 2913 2914 a0: target.c(), 2915 a1: uintptr(level), 2916 a2: uintptr(internalFormat), 2917 a3: uintptr(width), 2918 a4: uintptr(height), 2919 a5: format.c(), 2920 a6: ty.c(), 2921 }, 2922 parg: parg, 2923 blocking: true, 2924 }) 2925 } 2926 2927 func (ctx *context) TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte) { 2928 defer func() { 2929 errstr := ctx.errDrain() 2930 log.Printf("gl.TexSubImage2D(%v, %v, %v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, x, y, width, height, format, ty, len(data), errstr) 2931 }() 2932 ctx.enqueueDebug(call{ 2933 args: fnargs{ 2934 fn: glfnTexSubImage2D, 2935 2936 a0: target.c(), 2937 a1: uintptr(level), 2938 a2: uintptr(x), 2939 a3: uintptr(y), 2940 a4: uintptr(width), 2941 a5: uintptr(height), 2942 a6: format.c(), 2943 a7: ty.c(), 2944 }, 2945 parg: unsafe.Pointer(&data[0]), 2946 blocking: true, 2947 }) 2948 } 2949 2950 func (ctx *context) TexParameterf(target, pname Enum, param float32) { 2951 defer func() { 2952 errstr := ctx.errDrain() 2953 log.Printf("gl.TexParameterf(%v, %v, %v) %v", target, pname, param, errstr) 2954 }() 2955 ctx.enqueueDebug(call{ 2956 args: fnargs{ 2957 fn: glfnTexParameterf, 2958 a0: target.c(), 2959 a1: pname.c(), 2960 a2: uintptr(math.Float32bits(param)), 2961 }, 2962 blocking: true}) 2963 } 2964 2965 func (ctx *context) TexParameterfv(target, pname Enum, params []float32) { 2966 defer func() { 2967 errstr := ctx.errDrain() 2968 log.Printf("gl.TexParameterfv(%v, %v, len(%d)) %v", target, pname, len(params), errstr) 2969 }() 2970 ctx.enqueueDebug(call{ 2971 args: fnargs{ 2972 fn: glfnTexParameterfv, 2973 a0: target.c(), 2974 a1: pname.c(), 2975 }, 2976 parg: unsafe.Pointer(¶ms[0]), 2977 blocking: true, 2978 }) 2979 } 2980 2981 func (ctx *context) TexParameteri(target, pname Enum, param int) { 2982 defer func() { 2983 errstr := ctx.errDrain() 2984 log.Printf("gl.TexParameteri(%v, %v, %v) %v", target, pname, param, errstr) 2985 }() 2986 ctx.enqueueDebug(call{ 2987 args: fnargs{ 2988 fn: glfnTexParameteri, 2989 a0: target.c(), 2990 a1: pname.c(), 2991 a2: uintptr(param), 2992 }, 2993 blocking: true}) 2994 } 2995 2996 func (ctx *context) TexParameteriv(target, pname Enum, params []int32) { 2997 defer func() { 2998 errstr := ctx.errDrain() 2999 log.Printf("gl.TexParameteriv(%v, %v, %v) %v", target, pname, params, errstr) 3000 }() 3001 ctx.enqueueDebug(call{ 3002 args: fnargs{ 3003 fn: glfnTexParameteriv, 3004 a0: target.c(), 3005 a1: pname.c(), 3006 }, 3007 parg: unsafe.Pointer(¶ms[0]), 3008 blocking: true, 3009 }) 3010 } 3011 3012 func (ctx *context) Uniform1f(dst Uniform, v float32) { 3013 defer func() { 3014 errstr := ctx.errDrain() 3015 log.Printf("gl.Uniform1f(%v, %v) %v", dst, v, errstr) 3016 }() 3017 ctx.enqueueDebug(call{ 3018 args: fnargs{ 3019 fn: glfnUniform1f, 3020 a0: dst.c(), 3021 a1: uintptr(math.Float32bits(v)), 3022 }, 3023 blocking: true}) 3024 } 3025 3026 func (ctx *context) Uniform1fv(dst Uniform, src []float32) { 3027 defer func() { 3028 errstr := ctx.errDrain() 3029 log.Printf("gl.Uniform1fv(%v, len(%d)) %v", dst, len(src), errstr) 3030 }() 3031 ctx.enqueueDebug(call{ 3032 args: fnargs{ 3033 fn: glfnUniform1fv, 3034 a0: dst.c(), 3035 a1: uintptr(len(src)), 3036 }, 3037 parg: unsafe.Pointer(&src[0]), 3038 blocking: true, 3039 }) 3040 } 3041 3042 func (ctx *context) Uniform1i(dst Uniform, v int) { 3043 defer func() { 3044 errstr := ctx.errDrain() 3045 log.Printf("gl.Uniform1i(%v, %v) %v", dst, v, errstr) 3046 }() 3047 ctx.enqueueDebug(call{ 3048 args: fnargs{ 3049 fn: glfnUniform1i, 3050 a0: dst.c(), 3051 a1: uintptr(v), 3052 }, 3053 blocking: true}) 3054 } 3055 3056 func (ctx *context) Uniform1iv(dst Uniform, src []int32) { 3057 defer func() { 3058 errstr := ctx.errDrain() 3059 log.Printf("gl.Uniform1iv(%v, %v) %v", dst, src, errstr) 3060 }() 3061 ctx.enqueueDebug(call{ 3062 args: fnargs{ 3063 fn: glfnUniform1iv, 3064 a0: dst.c(), 3065 a1: uintptr(len(src)), 3066 }, 3067 parg: unsafe.Pointer(&src[0]), 3068 blocking: true, 3069 }) 3070 } 3071 3072 func (ctx *context) Uniform2f(dst Uniform, v0, v1 float32) { 3073 defer func() { 3074 errstr := ctx.errDrain() 3075 log.Printf("gl.Uniform2f(%v, %v, %v) %v", dst, v0, v1, errstr) 3076 }() 3077 ctx.enqueueDebug(call{ 3078 args: fnargs{ 3079 fn: glfnUniform2f, 3080 a0: dst.c(), 3081 a1: uintptr(math.Float32bits(v0)), 3082 a2: uintptr(math.Float32bits(v1)), 3083 }, 3084 blocking: true}) 3085 } 3086 3087 func (ctx *context) Uniform2fv(dst Uniform, src []float32) { 3088 defer func() { 3089 errstr := ctx.errDrain() 3090 log.Printf("gl.Uniform2fv(%v, len(%d)) %v", dst, len(src), errstr) 3091 }() 3092 ctx.enqueueDebug(call{ 3093 args: fnargs{ 3094 fn: glfnUniform2fv, 3095 a0: dst.c(), 3096 a1: uintptr(len(src) / 2), 3097 }, 3098 parg: unsafe.Pointer(&src[0]), 3099 blocking: true, 3100 }) 3101 } 3102 3103 func (ctx *context) Uniform2i(dst Uniform, v0, v1 int) { 3104 defer func() { 3105 errstr := ctx.errDrain() 3106 log.Printf("gl.Uniform2i(%v, %v, %v) %v", dst, v0, v1, errstr) 3107 }() 3108 ctx.enqueueDebug(call{ 3109 args: fnargs{ 3110 fn: glfnUniform2i, 3111 a0: dst.c(), 3112 a1: uintptr(v0), 3113 a2: uintptr(v1), 3114 }, 3115 blocking: true}) 3116 } 3117 3118 func (ctx *context) Uniform2iv(dst Uniform, src []int32) { 3119 defer func() { 3120 errstr := ctx.errDrain() 3121 log.Printf("gl.Uniform2iv(%v, %v) %v", dst, src, errstr) 3122 }() 3123 ctx.enqueueDebug(call{ 3124 args: fnargs{ 3125 fn: glfnUniform2iv, 3126 a0: dst.c(), 3127 a1: uintptr(len(src) / 2), 3128 }, 3129 parg: unsafe.Pointer(&src[0]), 3130 blocking: true, 3131 }) 3132 } 3133 3134 func (ctx *context) Uniform3f(dst Uniform, v0, v1, v2 float32) { 3135 defer func() { 3136 errstr := ctx.errDrain() 3137 log.Printf("gl.Uniform3f(%v, %v, %v, %v) %v", dst, v0, v1, v2, errstr) 3138 }() 3139 ctx.enqueueDebug(call{ 3140 args: fnargs{ 3141 fn: glfnUniform3f, 3142 a0: dst.c(), 3143 a1: uintptr(math.Float32bits(v0)), 3144 a2: uintptr(math.Float32bits(v1)), 3145 a3: uintptr(math.Float32bits(v2)), 3146 }, 3147 blocking: true}) 3148 } 3149 3150 func (ctx *context) Uniform3fv(dst Uniform, src []float32) { 3151 defer func() { 3152 errstr := ctx.errDrain() 3153 log.Printf("gl.Uniform3fv(%v, len(%d)) %v", dst, len(src), errstr) 3154 }() 3155 ctx.enqueueDebug(call{ 3156 args: fnargs{ 3157 fn: glfnUniform3fv, 3158 a0: dst.c(), 3159 a1: uintptr(len(src) / 3), 3160 }, 3161 parg: unsafe.Pointer(&src[0]), 3162 blocking: true, 3163 }) 3164 } 3165 3166 func (ctx *context) Uniform3i(dst Uniform, v0, v1, v2 int32) { 3167 defer func() { 3168 errstr := ctx.errDrain() 3169 log.Printf("gl.Uniform3i(%v, %v, %v, %v) %v", dst, v0, v1, v2, errstr) 3170 }() 3171 ctx.enqueueDebug(call{ 3172 args: fnargs{ 3173 fn: glfnUniform3i, 3174 a0: dst.c(), 3175 a1: uintptr(v0), 3176 a2: uintptr(v1), 3177 a3: uintptr(v2), 3178 }, 3179 blocking: true}) 3180 } 3181 3182 func (ctx *context) Uniform3iv(dst Uniform, src []int32) { 3183 defer func() { 3184 errstr := ctx.errDrain() 3185 log.Printf("gl.Uniform3iv(%v, %v) %v", dst, src, errstr) 3186 }() 3187 ctx.enqueueDebug(call{ 3188 args: fnargs{ 3189 fn: glfnUniform3iv, 3190 a0: dst.c(), 3191 a1: uintptr(len(src) / 3), 3192 }, 3193 parg: unsafe.Pointer(&src[0]), 3194 blocking: true, 3195 }) 3196 } 3197 3198 func (ctx *context) Uniform4f(dst Uniform, v0, v1, v2, v3 float32) { 3199 defer func() { 3200 errstr := ctx.errDrain() 3201 log.Printf("gl.Uniform4f(%v, %v, %v, %v, %v) %v", dst, v0, v1, v2, v3, errstr) 3202 }() 3203 ctx.enqueueDebug(call{ 3204 args: fnargs{ 3205 fn: glfnUniform4f, 3206 a0: dst.c(), 3207 a1: uintptr(math.Float32bits(v0)), 3208 a2: uintptr(math.Float32bits(v1)), 3209 a3: uintptr(math.Float32bits(v2)), 3210 a4: uintptr(math.Float32bits(v3)), 3211 }, 3212 blocking: true}) 3213 } 3214 3215 func (ctx *context) Uniform4fv(dst Uniform, src []float32) { 3216 defer func() { 3217 errstr := ctx.errDrain() 3218 log.Printf("gl.Uniform4fv(%v, len(%d)) %v", dst, len(src), errstr) 3219 }() 3220 ctx.enqueueDebug(call{ 3221 args: fnargs{ 3222 fn: glfnUniform4fv, 3223 a0: dst.c(), 3224 a1: uintptr(len(src) / 4), 3225 }, 3226 parg: unsafe.Pointer(&src[0]), 3227 blocking: true, 3228 }) 3229 } 3230 3231 func (ctx *context) Uniform4i(dst Uniform, v0, v1, v2, v3 int32) { 3232 defer func() { 3233 errstr := ctx.errDrain() 3234 log.Printf("gl.Uniform4i(%v, %v, %v, %v, %v) %v", dst, v0, v1, v2, v3, errstr) 3235 }() 3236 ctx.enqueueDebug(call{ 3237 args: fnargs{ 3238 fn: glfnUniform4i, 3239 a0: dst.c(), 3240 a1: uintptr(v0), 3241 a2: uintptr(v1), 3242 a3: uintptr(v2), 3243 a4: uintptr(v3), 3244 }, 3245 blocking: true}) 3246 } 3247 3248 func (ctx *context) Uniform4iv(dst Uniform, src []int32) { 3249 defer func() { 3250 errstr := ctx.errDrain() 3251 log.Printf("gl.Uniform4iv(%v, %v) %v", dst, src, errstr) 3252 }() 3253 ctx.enqueueDebug(call{ 3254 args: fnargs{ 3255 fn: glfnUniform4iv, 3256 a0: dst.c(), 3257 a1: uintptr(len(src) / 4), 3258 }, 3259 parg: unsafe.Pointer(&src[0]), 3260 blocking: true, 3261 }) 3262 } 3263 3264 func (ctx *context) UniformMatrix2fv(dst Uniform, src []float32) { 3265 defer func() { 3266 errstr := ctx.errDrain() 3267 log.Printf("gl.UniformMatrix2fv(%v, len(%d)) %v", dst, len(src), errstr) 3268 }() 3269 ctx.enqueueDebug(call{ 3270 args: fnargs{ 3271 fn: glfnUniformMatrix2fv, 3272 3273 a0: dst.c(), 3274 a1: uintptr(len(src) / 4), 3275 }, 3276 parg: unsafe.Pointer(&src[0]), 3277 blocking: true, 3278 }) 3279 } 3280 3281 func (ctx *context) UniformMatrix3fv(dst Uniform, src []float32) { 3282 defer func() { 3283 errstr := ctx.errDrain() 3284 log.Printf("gl.UniformMatrix3fv(%v, len(%d)) %v", dst, len(src), errstr) 3285 }() 3286 ctx.enqueueDebug(call{ 3287 args: fnargs{ 3288 fn: glfnUniformMatrix3fv, 3289 a0: dst.c(), 3290 a1: uintptr(len(src) / 9), 3291 }, 3292 parg: unsafe.Pointer(&src[0]), 3293 blocking: true, 3294 }) 3295 } 3296 3297 func (ctx *context) UniformMatrix4fv(dst Uniform, src []float32) { 3298 defer func() { 3299 errstr := ctx.errDrain() 3300 log.Printf("gl.UniformMatrix4fv(%v, len(%d)) %v", dst, len(src), errstr) 3301 }() 3302 ctx.enqueueDebug(call{ 3303 args: fnargs{ 3304 fn: glfnUniformMatrix4fv, 3305 a0: dst.c(), 3306 a1: uintptr(len(src) / 16), 3307 }, 3308 parg: unsafe.Pointer(&src[0]), 3309 blocking: true, 3310 }) 3311 } 3312 3313 func (ctx *context) UseProgram(p Program) { 3314 defer func() { 3315 errstr := ctx.errDrain() 3316 log.Printf("gl.UseProgram(%v) %v", p, errstr) 3317 }() 3318 ctx.enqueueDebug(call{ 3319 args: fnargs{ 3320 fn: glfnUseProgram, 3321 a0: p.c(), 3322 }, 3323 blocking: true}) 3324 } 3325 3326 func (ctx *context) ValidateProgram(p Program) { 3327 defer func() { 3328 errstr := ctx.errDrain() 3329 log.Printf("gl.ValidateProgram(%v) %v", p, errstr) 3330 }() 3331 ctx.enqueueDebug(call{ 3332 args: fnargs{ 3333 fn: glfnValidateProgram, 3334 a0: p.c(), 3335 }, 3336 blocking: true}) 3337 } 3338 3339 func (ctx *context) VertexAttrib1f(dst Attrib, x float32) { 3340 defer func() { 3341 errstr := ctx.errDrain() 3342 log.Printf("gl.VertexAttrib1f(%v, %v) %v", dst, x, errstr) 3343 }() 3344 ctx.enqueueDebug(call{ 3345 args: fnargs{ 3346 fn: glfnVertexAttrib1f, 3347 a0: dst.c(), 3348 a1: uintptr(math.Float32bits(x)), 3349 }, 3350 blocking: true}) 3351 } 3352 3353 func (ctx *context) VertexAttrib1fv(dst Attrib, src []float32) { 3354 defer func() { 3355 errstr := ctx.errDrain() 3356 log.Printf("gl.VertexAttrib1fv(%v, len(%d)) %v", dst, len(src), errstr) 3357 }() 3358 ctx.enqueueDebug(call{ 3359 args: fnargs{ 3360 fn: glfnVertexAttrib1fv, 3361 a0: dst.c(), 3362 }, 3363 parg: unsafe.Pointer(&src[0]), 3364 blocking: true, 3365 }) 3366 } 3367 3368 func (ctx *context) VertexAttrib2f(dst Attrib, x, y float32) { 3369 defer func() { 3370 errstr := ctx.errDrain() 3371 log.Printf("gl.VertexAttrib2f(%v, %v, %v) %v", dst, x, y, errstr) 3372 }() 3373 ctx.enqueueDebug(call{ 3374 args: fnargs{ 3375 fn: glfnVertexAttrib2f, 3376 a0: dst.c(), 3377 a1: uintptr(math.Float32bits(x)), 3378 a2: uintptr(math.Float32bits(y)), 3379 }, 3380 blocking: true}) 3381 } 3382 3383 func (ctx *context) VertexAttrib2fv(dst Attrib, src []float32) { 3384 defer func() { 3385 errstr := ctx.errDrain() 3386 log.Printf("gl.VertexAttrib2fv(%v, len(%d)) %v", dst, len(src), errstr) 3387 }() 3388 ctx.enqueueDebug(call{ 3389 args: fnargs{ 3390 fn: glfnVertexAttrib2fv, 3391 a0: dst.c(), 3392 }, 3393 parg: unsafe.Pointer(&src[0]), 3394 blocking: true, 3395 }) 3396 } 3397 3398 func (ctx *context) VertexAttrib3f(dst Attrib, x, y, z float32) { 3399 defer func() { 3400 errstr := ctx.errDrain() 3401 log.Printf("gl.VertexAttrib3f(%v, %v, %v, %v) %v", dst, x, y, z, errstr) 3402 }() 3403 ctx.enqueueDebug(call{ 3404 args: fnargs{ 3405 fn: glfnVertexAttrib3f, 3406 a0: dst.c(), 3407 a1: uintptr(math.Float32bits(x)), 3408 a2: uintptr(math.Float32bits(y)), 3409 a3: uintptr(math.Float32bits(z)), 3410 }, 3411 blocking: true}) 3412 } 3413 3414 func (ctx *context) VertexAttrib3fv(dst Attrib, src []float32) { 3415 defer func() { 3416 errstr := ctx.errDrain() 3417 log.Printf("gl.VertexAttrib3fv(%v, len(%d)) %v", dst, len(src), errstr) 3418 }() 3419 ctx.enqueueDebug(call{ 3420 args: fnargs{ 3421 fn: glfnVertexAttrib3fv, 3422 a0: dst.c(), 3423 }, 3424 parg: unsafe.Pointer(&src[0]), 3425 blocking: true, 3426 }) 3427 } 3428 3429 func (ctx *context) VertexAttrib4f(dst Attrib, x, y, z, w float32) { 3430 defer func() { 3431 errstr := ctx.errDrain() 3432 log.Printf("gl.VertexAttrib4f(%v, %v, %v, %v, %v) %v", dst, x, y, z, w, errstr) 3433 }() 3434 ctx.enqueueDebug(call{ 3435 args: fnargs{ 3436 fn: glfnVertexAttrib4f, 3437 a0: dst.c(), 3438 a1: uintptr(math.Float32bits(x)), 3439 a2: uintptr(math.Float32bits(y)), 3440 a3: uintptr(math.Float32bits(z)), 3441 a4: uintptr(math.Float32bits(w)), 3442 }, 3443 blocking: true}) 3444 } 3445 3446 func (ctx *context) VertexAttrib4fv(dst Attrib, src []float32) { 3447 defer func() { 3448 errstr := ctx.errDrain() 3449 log.Printf("gl.VertexAttrib4fv(%v, len(%d)) %v", dst, len(src), errstr) 3450 }() 3451 ctx.enqueueDebug(call{ 3452 args: fnargs{ 3453 fn: glfnVertexAttrib4fv, 3454 a0: dst.c(), 3455 }, 3456 parg: unsafe.Pointer(&src[0]), 3457 blocking: true, 3458 }) 3459 } 3460 3461 func (ctx *context) VertexAttribPointer(dst Attrib, size int, ty Enum, normalized bool, stride, offset int) { 3462 defer func() { 3463 errstr := ctx.errDrain() 3464 log.Printf("gl.VertexAttribPointer(%v, %v, %v, %v, %v, %v) %v", dst, size, ty, normalized, stride, offset, errstr) 3465 }() 3466 ctx.enqueueDebug(call{ 3467 args: fnargs{ 3468 fn: glfnVertexAttribPointer, 3469 a0: dst.c(), 3470 a1: uintptr(size), 3471 a2: ty.c(), 3472 a3: glBoolean(normalized), 3473 a4: uintptr(stride), 3474 a5: uintptr(offset), 3475 }, 3476 blocking: true}) 3477 } 3478 3479 func (ctx *context) Viewport(x, y, width, height int) { 3480 defer func() { 3481 errstr := ctx.errDrain() 3482 log.Printf("gl.Viewport(%v, %v, %v, %v) %v", x, y, width, height, errstr) 3483 }() 3484 ctx.enqueueDebug(call{ 3485 args: fnargs{ 3486 fn: glfnViewport, 3487 a0: uintptr(x), 3488 a1: uintptr(y), 3489 a2: uintptr(width), 3490 a3: uintptr(height), 3491 }, 3492 blocking: true}) 3493 } 3494 3495 func (ctx context3) UniformMatrix2x3fv(dst Uniform, src []float32) { 3496 defer func() { 3497 errstr := ctx.errDrain() 3498 log.Printf("gl.UniformMatrix2x3fv(%v, len(%d)) %v", dst, len(src), errstr) 3499 }() 3500 ctx.enqueueDebug(call{ 3501 args: fnargs{ 3502 fn: glfnUniformMatrix2x3fv, 3503 a0: dst.c(), 3504 a1: uintptr(len(src) / 6), 3505 }, 3506 parg: unsafe.Pointer(&src[0]), 3507 blocking: true, 3508 }) 3509 } 3510 3511 func (ctx context3) UniformMatrix3x2fv(dst Uniform, src []float32) { 3512 defer func() { 3513 errstr := ctx.errDrain() 3514 log.Printf("gl.UniformMatrix3x2fv(%v, len(%d)) %v", dst, len(src), errstr) 3515 }() 3516 ctx.enqueueDebug(call{ 3517 args: fnargs{ 3518 fn: glfnUniformMatrix3x2fv, 3519 a0: dst.c(), 3520 a1: uintptr(len(src) / 6), 3521 }, 3522 parg: unsafe.Pointer(&src[0]), 3523 blocking: true, 3524 }) 3525 } 3526 3527 func (ctx context3) UniformMatrix2x4fv(dst Uniform, src []float32) { 3528 defer func() { 3529 errstr := ctx.errDrain() 3530 log.Printf("gl.UniformMatrix2x4fv(%v, len(%d)) %v", dst, len(src), errstr) 3531 }() 3532 ctx.enqueueDebug(call{ 3533 args: fnargs{ 3534 fn: glfnUniformMatrix2x4fv, 3535 a0: dst.c(), 3536 a1: uintptr(len(src) / 8), 3537 }, 3538 parg: unsafe.Pointer(&src[0]), 3539 blocking: true, 3540 }) 3541 } 3542 3543 func (ctx context3) UniformMatrix4x2fv(dst Uniform, src []float32) { 3544 defer func() { 3545 errstr := ctx.errDrain() 3546 log.Printf("gl.UniformMatrix4x2fv(%v, len(%d)) %v", dst, len(src), errstr) 3547 }() 3548 ctx.enqueueDebug(call{ 3549 args: fnargs{ 3550 fn: glfnUniformMatrix4x2fv, 3551 a0: dst.c(), 3552 a1: uintptr(len(src) / 8), 3553 }, 3554 parg: unsafe.Pointer(&src[0]), 3555 blocking: true, 3556 }) 3557 } 3558 3559 func (ctx context3) UniformMatrix3x4fv(dst Uniform, src []float32) { 3560 defer func() { 3561 errstr := ctx.errDrain() 3562 log.Printf("gl.UniformMatrix3x4fv(%v, len(%d)) %v", dst, len(src), errstr) 3563 }() 3564 ctx.enqueueDebug(call{ 3565 args: fnargs{ 3566 fn: glfnUniformMatrix3x4fv, 3567 a0: dst.c(), 3568 a1: uintptr(len(src) / 12), 3569 }, 3570 parg: unsafe.Pointer(&src[0]), 3571 blocking: true, 3572 }) 3573 } 3574 3575 func (ctx context3) UniformMatrix4x3fv(dst Uniform, src []float32) { 3576 defer func() { 3577 errstr := ctx.errDrain() 3578 log.Printf("gl.UniformMatrix4x3fv(%v, len(%d)) %v", dst, len(src), errstr) 3579 }() 3580 ctx.enqueueDebug(call{ 3581 args: fnargs{ 3582 fn: glfnUniformMatrix4x3fv, 3583 a0: dst.c(), 3584 a1: uintptr(len(src) / 12), 3585 }, 3586 parg: unsafe.Pointer(&src[0]), 3587 blocking: true, 3588 }) 3589 } 3590 3591 func (ctx context3) BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1 int, mask uint, filter Enum) { 3592 defer func() { 3593 errstr := ctx.errDrain() 3594 log.Printf("gl.BlitFramebuffer(%v, %v, %v, %v, %v, %v, %v, %v, %v, %v) %v", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter, errstr) 3595 }() 3596 ctx.enqueueDebug(call{ 3597 args: fnargs{ 3598 fn: glfnBlitFramebuffer, 3599 a0: uintptr(srcX0), 3600 a1: uintptr(srcY0), 3601 a2: uintptr(srcX1), 3602 a3: uintptr(srcY1), 3603 a4: uintptr(dstX0), 3604 a5: uintptr(dstY0), 3605 a6: uintptr(dstX1), 3606 a7: uintptr(dstY1), 3607 a8: uintptr(mask), 3608 a9: filter.c(), 3609 }, 3610 blocking: true}) 3611 } 3612 3613 func (ctx context3) Uniform1ui(dst Uniform, v uint32) { 3614 defer func() { 3615 errstr := ctx.errDrain() 3616 log.Printf("gl.Uniform1ui(%v, %v) %v", dst, v, errstr) 3617 }() 3618 ctx.enqueueDebug(call{ 3619 args: fnargs{ 3620 fn: glfnUniform1ui, 3621 a0: dst.c(), 3622 a1: uintptr(v), 3623 }, 3624 blocking: true}) 3625 } 3626 3627 func (ctx context3) Uniform2ui(dst Uniform, v0, v1 uint32) { 3628 defer func() { 3629 errstr := ctx.errDrain() 3630 log.Printf("gl.Uniform2ui(%v, %v, %v) %v", dst, v0, v1, errstr) 3631 }() 3632 ctx.enqueueDebug(call{ 3633 args: fnargs{ 3634 fn: glfnUniform2ui, 3635 a0: dst.c(), 3636 a1: uintptr(v0), 3637 a2: uintptr(v1), 3638 }, 3639 blocking: true}) 3640 } 3641 3642 func (ctx context3) Uniform3ui(dst Uniform, v0, v1, v2 uint) { 3643 defer func() { 3644 errstr := ctx.errDrain() 3645 log.Printf("gl.Uniform3ui(%v, %v, %v, %v) %v", dst, v0, v1, v2, errstr) 3646 }() 3647 ctx.enqueueDebug(call{ 3648 args: fnargs{ 3649 fn: glfnUniform3ui, 3650 a0: dst.c(), 3651 a1: uintptr(v0), 3652 a2: uintptr(v1), 3653 a3: uintptr(v2), 3654 }, 3655 blocking: true}) 3656 } 3657 3658 func (ctx context3) Uniform4ui(dst Uniform, v0, v1, v2, v3 uint32) { 3659 defer func() { 3660 errstr := ctx.errDrain() 3661 log.Printf("gl.Uniform4ui(%v, %v, %v, %v, %v) %v", dst, v0, v1, v2, v3, errstr) 3662 }() 3663 ctx.enqueueDebug(call{ 3664 args: fnargs{ 3665 fn: glfnUniform4ui, 3666 a0: dst.c(), 3667 a1: uintptr(v0), 3668 a2: uintptr(v1), 3669 a3: uintptr(v2), 3670 a4: uintptr(v3), 3671 }, 3672 blocking: true}) 3673 }