cogl-gles2-api.c 25.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243

#include <GLES2/gl2.h>

#include <cogl/cogl-gles2.h>

void
glBindTexture (GLenum target, GLuint texture)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glBindTexture (target, texture);
}

void
glBlendFunc (GLenum sfactor, GLenum dfactor)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glBlendFunc (sfactor, dfactor);
}

void
glClear (GLbitfield mask)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glClear (mask);
}

void
glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glClearColor (red, green, blue, alpha);
}

void
glClearStencil (GLint s)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glClearStencil (s);
}

void
glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glColorMask (red, green, blue, alpha);
}

void
glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset,
		     GLint x, GLint y, GLsizei width, GLsizei height)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glCopyTexSubImage2D (target, level, xoffset, yoffset, x, y, width,
			       height);
}

void
glDeleteTextures (GLsizei n, const GLuint * textures)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDeleteTextures (n, textures);
}

void
glDepthFunc (GLenum func)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDepthFunc (func);
}

void
glDepthMask (GLboolean flag)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDepthMask (flag);
}

void
glDisable (GLenum cap)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDisable (cap);
}

void
glDrawArrays (GLenum mode, GLint first, GLsizei count)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDrawArrays (mode, first, count);
}

void
glDrawElements (GLenum mode, GLsizei count, GLenum type,
		const GLvoid * indices)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDrawElements (mode, count, type, indices);
}

void
glEnable (GLenum cap)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glEnable (cap);
}

void
glFinish (void)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glFinish ();
}

void
glFlush (void)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glFlush ();
}

void
glFrontFace (GLenum mode)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glFrontFace (mode);
}

void
glCullFace (GLenum mode)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glCullFace (mode);
}

void
glGenTextures (GLsizei n, GLuint * textures)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGenTextures (n, textures);
}

GLenum
glGetError (void)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glGetError ();
}

void
glGetIntegerv (GLenum pname, GLint * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetIntegerv (pname, params);
}

void
glGetBooleanv (GLenum pname, GLboolean * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetBooleanv (pname, params);
}

void
glGetFloatv (GLenum pname, GLfloat * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetFloatv (pname, params);
}

const GLubyte *
glGetString (GLenum name)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glGetString (name);
}

void
glHint (GLenum target, GLenum mode)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glHint (target, mode);
}

GLboolean
glIsTexture (GLuint texture)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glIsTexture (texture);
}

void
glPixelStorei (GLenum pname, GLint param)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glPixelStorei (pname, param);
}

void
glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
	      GLenum type, GLvoid * pixels)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glReadPixels (x, y, width, height, format, type, pixels);
}

void
glScissor (GLint x, GLint y, GLsizei width, GLsizei height)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glScissor (x, y, width, height);
}

void
glStencilFunc (GLenum func, GLint ref, GLuint mask)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glStencilFunc (func, ref, mask);
}

void
glStencilMask (GLuint mask)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glStencilMask (mask);
}

void
glStencilOp (GLenum fail, GLenum zfail, GLenum zpass)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glStencilOp (fail, zfail, zpass);
}

void
glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width,
	      GLsizei height, GLint border, GLenum format, GLenum type,
	      const GLvoid * pixels)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glTexImage2D (target, level, internalformat, width, height, border,
			format, type, pixels);
}

244 245 246 247 248 249 250
void
glTexParameterf (GLenum target, GLenum pname, GLfloat param)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glTexParameterf (target, pname, param);
}

251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048
void
glTexParameterfv (GLenum target, GLenum pname, const GLfloat * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glTexParameterfv (target, pname, params);
}

void
glTexParameteri (GLenum target, GLenum pname, GLint param)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glTexParameteri (target, pname, param);
}

void
glTexParameteriv (GLenum target, GLenum pname, const GLint * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glTexParameteriv (target, pname, params);
}

void
glGetTexParameterfv (GLenum target, GLenum pname, GLfloat * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetTexParameterfv (target, pname, params);
}

void
glGetTexParameteriv (GLenum target, GLenum pname, GLint * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetTexParameteriv (target, pname, params);
}

void
glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset,
		 GLsizei width, GLsizei height, GLenum format, GLenum type,
		 const GLvoid * pixels)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glTexSubImage2D (target, level, xoffset, yoffset, width, height,
			   format, type, pixels);
}

void
glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x,
		  GLint y, GLsizei width, GLsizei height, GLint border)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glCopyTexImage2D (target, level, internalformat,
			    x, y, width, height, border);
}

void
glViewport (GLint x, GLint y, GLsizei width, GLsizei height)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glViewport (x, y, width, height);
}

GLboolean
glIsEnabled (GLenum cap)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glIsEnabled (cap);
}

void
glLineWidth (GLfloat width)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glLineWidth (width);
}

void
glPolygonOffset (GLfloat factor, GLfloat units)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glPolygonOffset (factor, units);
}

void
glDepthRangef (GLfloat near_val, GLfloat far_val)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDepthRangef (near_val, far_val);
}

void
glClearDepthf (GLclampf depth)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glClearDepthf (depth);
}

void
glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat,
			GLsizei width, GLsizei height, GLint border,
			GLsizei imageSize, const GLvoid * data)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glCompressedTexImage2D (target, level, internalformat, width,
				  height, border, imageSize, data);
}

void
glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset,
			   GLint yoffset, GLsizei width, GLsizei height,
			   GLenum format, GLsizei imageSize,
			   const GLvoid * data)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glCompressedTexSubImage2D (target, level,
				     xoffset, yoffset, width, height,
				     format, imageSize, data);
}

void
glSampleCoverage (GLclampf value, GLboolean invert)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glSampleCoverage (value, invert);
}

void
glGetBufferParameteriv (GLenum target, GLenum pname, GLint * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetBufferParameteriv (target, pname, params);
}

void
glGenBuffers (GLsizei n, GLuint * buffers)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGenBuffers (n, buffers);
}

void
glBindBuffer (GLenum target, GLuint buffer)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glBindBuffer (target, buffer);
}

void
glBufferData (GLenum target, GLsizeiptr size, const GLvoid * data,
	      GLenum usage)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glBufferData (target, size, data, usage);
}

void
glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size,
		 const GLvoid * data)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glBufferSubData (target, offset, size, data);
}

void
glDeleteBuffers (GLsizei n, const GLuint * buffers)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDeleteBuffers (n, buffers);
}

GLboolean
glIsBuffer (GLuint buffer)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glIsBuffer (buffer);
}

void
glActiveTexture (GLenum texture)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glActiveTexture (texture);
}

void
glGenRenderbuffers (GLsizei n, GLuint * renderbuffers)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGenRenderbuffers (n, renderbuffers);
}

void
glDeleteRenderbuffers (GLsizei n, const GLuint * renderbuffers)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDeleteRenderbuffers (n, renderbuffers);
}

void
glBindRenderbuffer (GLenum target, GLuint renderbuffer)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glBindRenderbuffer (target, renderbuffer);
}

void
glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width,
		       GLsizei height)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glRenderbufferStorage (target, internalformat, width, height);
}

void
glGenFramebuffers (GLsizei n, GLuint * framebuffers)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGenFramebuffers (n, framebuffers);
}

void
glBindFramebuffer (GLenum target, GLuint framebuffer)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glBindFramebuffer (target, framebuffer);
}

void
glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget,
			GLuint texture, GLint level)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glFramebufferTexture2D (target, attachment,
				  textarget, texture, level);
}

void
glFramebufferRenderbuffer (GLenum target, GLenum attachment,
			   GLenum renderbuffertarget, GLuint renderbuffer)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glFramebufferRenderbuffer (target, attachment,
				     renderbuffertarget, renderbuffer);
}

GLboolean
glIsRenderbuffer (GLuint renderbuffer)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glIsRenderbuffer (renderbuffer);
}

GLenum
glCheckFramebufferStatus (GLenum target)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glCheckFramebufferStatus (target);
}

void
glDeleteFramebuffers (GLsizei n, const GLuint * framebuffers)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDeleteFramebuffers (n, framebuffers);
}

void
glGenerateMipmap (GLenum target)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGenerateMipmap (target);
}

void
glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment,
				       GLenum pname, GLint * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetFramebufferAttachmentParameteriv (target,
						 attachment, pname, params);
}

void
glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetRenderbufferParameteriv (target, pname, params);
}

GLboolean
glIsFramebuffer (GLuint framebuffer)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glIsFramebuffer (framebuffer);
}

void
glBlendEquation (GLenum mode)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glBlendEquation (mode);
}

void
glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glBlendColor (red, green, blue, alpha);
}

void
glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha,
		     GLenum dstAlpha)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glBlendFuncSeparate (srcRGB, dstRGB, srcAlpha, dstAlpha);
}

void
glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glBlendEquationSeparate (modeRGB, modeAlpha);
}

void
glReleaseShaderCompiler (void)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glReleaseShaderCompiler ();
}

void
glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype,
			    GLint * range, GLint * precision)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetShaderPrecisionFormat (shadertype, precisiontype,
				      range, precision);
}

void
glShaderBinary (GLsizei n, const GLuint * shaders, GLenum binaryformat,
		const GLvoid * binary, GLsizei length)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glShaderBinary (n, shaders, binaryformat, binary, length);
}

void
glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glStencilFuncSeparate (face, func, ref, mask);
}

void
glStencilMaskSeparate (GLenum face, GLuint mask)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glStencilMaskSeparate (face, mask);
}

void
glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glStencilOpSeparate (face, fail, zfail, zpass);
}

GLuint
glCreateProgram (void)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glCreateProgram ();
}

GLuint
glCreateShader (GLenum shaderType)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glCreateShader (shaderType);
}

void
glShaderSource (GLuint shader, GLsizei count,
		const GLchar * const *string, const GLint * length)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glShaderSource (shader, count, string, length);
}

void
glCompileShader (GLuint shader)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glCompileShader (shader);
}

void
glDeleteShader (GLuint shader)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDeleteShader (shader);
}

void
glAttachShader (GLuint program, GLuint shader)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glAttachShader (program, shader);
}

void
glLinkProgram (GLuint program)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glLinkProgram (program);
}

void
glUseProgram (GLuint program)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUseProgram (program);
}

GLint
glGetUniformLocation (GLuint program, const char *name)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glGetUniformLocation (program, name);
}

void
glDeleteProgram (GLuint program)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDeleteProgram (program);
}

void
glGetShaderInfoLog (GLuint shader, GLsizei maxLength, GLsizei * length,
		    char *infoLog)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetShaderInfoLog (shader, maxLength, length, infoLog);
}

void
glGetShaderiv (GLuint shader, GLenum pname, GLint * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetShaderiv (shader, pname, params);
}

void
glVertexAttribPointer (GLuint index, GLint size, GLenum type,
		       GLboolean normalized, GLsizei stride,
		       const GLvoid * pointer)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glVertexAttribPointer (index, size, type, normalized, stride,
				 pointer);
}

void
glEnableVertexAttribArray (GLuint index)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glEnableVertexAttribArray (index);
}

void
glDisableVertexAttribArray (GLuint index)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDisableVertexAttribArray (index);
}

void
glUniform1f (GLint location, GLfloat v0)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform1f (location, v0);
}

void
glUniform2f (GLint location, GLfloat v0, GLfloat v1)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform2f (location, v0, v1);
}

void
glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform3f (location, v0, v1, v2);
}

void
glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform4f (location, v0, v1, v2, v3);
}

void
glUniform1fv (GLint location, GLsizei count, const GLfloat * value)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform1fv (location, count, value);
}

void
glUniform2fv (GLint location, GLsizei count, const GLfloat * value)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform2fv (location, count, value);
}

void
glUniform3fv (GLint location, GLsizei count, const GLfloat * value)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform3fv (location, count, value);
}

void
glUniform4fv (GLint location, GLsizei count, const GLfloat * value)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform4fv (location, count, value);
}

void
glUniform1i (GLint location, GLint v0)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform1i (location, v0);
}

void
glUniform2i (GLint location, GLint v0, GLint v1)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform2i (location, v0, v1);
}

void
glUniform3i (GLint location, GLint v0, GLint v1, GLint v2)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform3i (location, v0, v1, v2);
}

void
glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform4i (location, v0, v1, v2, v3);
}

void
glUniform1iv (GLint location, GLsizei count, const GLint * value)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform1iv (location, count, value);
}

void
glUniform2iv (GLint location, GLsizei count, const GLint * value)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform2iv (location, count, value);
}

void
glUniform3iv (GLint location, GLsizei count, const GLint * value)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform3iv (location, count, value);
}

void
glUniform4iv (GLint location, GLsizei count, const GLint * value)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniform4iv (location, count, value);
}

void
glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose,
		    const GLfloat * value)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniformMatrix2fv (location, count, transpose, value);
}

void
glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose,
		    const GLfloat * value)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniformMatrix3fv (location, count, transpose, value);
}

void
glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose,
		    const GLfloat * value)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glUniformMatrix4fv (location, count, transpose, value);
}

void
glGetUniformfv (GLuint program, GLint location, GLfloat * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetUniformfv (program, location, params);
}

void
glGetUniformiv (GLuint program, GLint location, GLint * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetUniformiv (program, location, params);
}

void
glGetProgramiv (GLuint program, GLenum pname, GLint * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetProgramiv (program, pname, params);
}

void
glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei * length,
		     char *infoLog)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetProgramInfoLog (program, bufSize, length, infoLog);
}

void
glVertexAttrib1f (GLuint indx, GLfloat x)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glVertexAttrib1f (indx, x);
}

void
glVertexAttrib1fv (GLuint indx, const GLfloat * values)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glVertexAttrib1fv (indx, values);
}

void
glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glVertexAttrib2f (indx, x, y);
}

void
glVertexAttrib2fv (GLuint indx, const GLfloat * values)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glVertexAttrib2fv (indx, values);
}

void
glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glVertexAttrib3f (indx, x, y, z);
}

void
glVertexAttrib3fv (GLuint indx, const GLfloat * values)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glVertexAttrib3fv (indx, values);
}

void
glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glVertexAttrib4f (index, x, y, z, w);
}

void
glVertexAttrib4fv (GLuint indx, const GLfloat * values)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glVertexAttrib4fv (indx, values);
}

void
glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetVertexAttribfv (index, pname, params);
}

void
glGetVertexAttribiv (GLuint index, GLenum pname, GLint * params)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetVertexAttribiv (index, pname, params);
}

void
glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid ** pointer)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetVertexAttribPointerv (index, pname, pointer);
}

GLint
glGetAttribLocation (GLuint program, const char *name)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glGetAttribLocation (program, name);
}

void
glBindAttribLocation (GLuint program, GLuint index, const GLchar * name)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glBindAttribLocation (program, index, name);
}

void
glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize,
		   GLsizei * length, GLint * size, GLenum * type,
		   GLchar * name)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetActiveAttrib (program, index, bufsize, length, size, type,
			     name);
}

void
glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize,
		    GLsizei * length, GLint * size, GLenum * type,
		    GLchar * name)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetActiveUniform (program, index, bufsize, length, size, type,
			      name);
}

void
glDetachShader (GLuint program, GLuint shader)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glDetachShader (program, shader);
}

void
glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei * count,
		      GLuint * shaders)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetAttachedShaders (program, maxcount, count, shaders);
}

void
glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei * length,
		   GLchar * source)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glGetShaderSource (shader, bufsize, length, source);
}

GLboolean
glIsShader (GLuint shader)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glIsShader (shader);
}

GLboolean
glIsProgram (GLuint program)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  return vtable->glIsProgram (program);
}

void
glValidateProgram (GLuint program)
{
  CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
  vtable->glValidateProgram (program);
}