Home | History | Annotate | Download | only in replicaisland
      1 /*
      2  * Copyright (C) 2010 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17  package com.replica.replicaisland;
     18 
     19 import java.nio.Buffer;
     20 import java.nio.FloatBuffer;
     21 import java.nio.IntBuffer;
     22 import java.nio.ShortBuffer;
     23 
     24 import javax.microedition.khronos.opengles.GL;
     25 import javax.microedition.khronos.opengles.GL10;
     26 import javax.microedition.khronos.opengles.GL10Ext;
     27 import javax.microedition.khronos.opengles.GL11;
     28 import javax.microedition.khronos.opengles.GL11Ext;
     29 
     30 import android.opengl.GLU;
     31 
     32 public class GLErrorLogger implements GLSurfaceView.GLWrapper {
     33 
     34 	public GL wrap(GL gl) {
     35 		return new ErrorLoggingGL(gl);
     36 	}
     37 
     38 	static class ErrorLoggingGL implements GL, GL10, GL10Ext, GL11, GL11Ext {
     39 		private GL mGL;
     40 
     41 		public ErrorLoggingGL(GL gl) {
     42 			mGL = gl;
     43 		}
     44 
     45 		public void checkError() {
     46 
     47 			int error = ((GL10)mGL).glGetError();
     48             if (error != GL10.GL_NO_ERROR) {
     49             	String method = Thread.currentThread().getStackTrace()[3].getMethodName();
     50                 DebugLog.d("GL ERROR", "Error: " + error + " (" + GLU.gluErrorString(error) + "): " + method);
     51             }
     52 
     53             assert error == GL10.GL_NO_ERROR;
     54         }
     55 
     56 		public void glActiveTexture(int texture) {
     57 			((GL10) mGL).glActiveTexture(texture);
     58 			checkError();
     59 		}
     60 
     61 		public void glAlphaFunc(int func, float ref) {
     62 			((GL10)mGL).glAlphaFunc(func, ref);
     63 			checkError();
     64 		}
     65 
     66 		public void glAlphaFuncx(int func, int ref) {
     67 			((GL10)mGL).glAlphaFuncx(func, ref);
     68 			checkError();
     69 		}
     70 
     71 		public void glBindTexture(int target, int texture) {
     72 			((GL10)mGL).glBindTexture(target, texture);
     73 			checkError();
     74 		}
     75 
     76 		public void glBlendFunc(int sfactor, int dfactor) {
     77 			((GL10)mGL).glBlendFunc(sfactor, dfactor);
     78 			checkError();
     79 		}
     80 
     81 		public void glClear(int mask) {
     82 			((GL10)mGL).glClear(mask);
     83 			checkError();
     84 		}
     85 
     86 		public void glClearColor(float red, float green, float blue, float alpha) {
     87 			((GL10)mGL).glClearColor(red, green, blue, alpha);
     88 			checkError();
     89 		}
     90 
     91 		public void glClearColorx(int red, int green, int blue, int alpha) {
     92 			((GL10)mGL).glClearColorx(red, green, blue, alpha);
     93 			checkError();
     94 		}
     95 
     96 		public void glClearDepthf(float depth) {
     97 			((GL10)mGL).glClearDepthf(depth);
     98 			checkError();
     99 		}
    100 
    101 		public void glClearDepthx(int depth) {
    102 			((GL10)mGL).glClearDepthx(depth);
    103 			checkError();
    104 		}
    105 
    106 		public void glClearStencil(int s) {
    107 			((GL10)mGL).glClearStencil(s);
    108 			checkError();
    109 		}
    110 
    111 		public void glClientActiveTexture(int texture) {
    112 			((GL10)mGL).glClientActiveTexture(texture);
    113 			checkError();
    114 		}
    115 
    116 		public void glColor4f(float red, float green, float blue, float alpha) {
    117 			((GL10)mGL).glColor4f(red, green, blue, alpha);
    118 			checkError();
    119 		}
    120 
    121 		public void glColor4x(int red, int green, int blue, int alpha) {
    122 			((GL10)mGL).glColor4x(red, green, blue, alpha);
    123 			checkError();
    124 		}
    125 
    126 		public void glColorMask(boolean red, boolean green, boolean blue,
    127 				boolean alpha) {
    128 			((GL10)mGL).glColorMask(red, green, blue, alpha);
    129 			checkError();
    130 		}
    131 
    132 		public void glColorPointer(int size, int type, int stride,
    133 				Buffer pointer) {
    134 			((GL10)mGL).glColorPointer(size, type, stride, pointer);
    135 			checkError();
    136 		}
    137 
    138 		public void glCompressedTexImage2D(int target, int level,
    139 				int internalformat, int width, int height, int border,
    140 				int imageSize, Buffer data) {
    141 			((GL10)mGL).glCompressedTexImage2D(target, level,
    142 					internalformat, width, height, border, imageSize, data);
    143 			checkError();
    144 		}
    145 
    146 		public void glCompressedTexSubImage2D(int target, int level,
    147 				int xoffset, int yoffset, int width, int height, int format,
    148 				int imageSize, Buffer data) {
    149 			((GL10)mGL).glCompressedTexSubImage2D( target,  level,
    150 					 xoffset,  yoffset,  width,  height,  format,
    151 					 imageSize,  data);
    152 			checkError();
    153 		}
    154 
    155 		public void glCopyTexImage2D(int target, int level, int internalformat,
    156 				int x, int y, int width, int height, int border) {
    157 			((GL10)mGL).glCopyTexImage2D( target,  level,  internalformat,
    158 					 x,  y,  width,  height,  border);
    159 			checkError();
    160 
    161 		}
    162 
    163 		public void glCopyTexSubImage2D(int target, int level, int xoffset,
    164 				int yoffset, int x, int y, int width, int height) {
    165 			((GL10)mGL).glCopyTexSubImage2D( target,  level,  xoffset,
    166 					 yoffset,  x,  y,  width,  height);
    167 			checkError();
    168 		}
    169 
    170 		public void glCullFace(int mode) {
    171 			((GL10)mGL).glCullFace(mode);
    172 			checkError();
    173 		}
    174 
    175 		public void glDeleteTextures(int n, IntBuffer textures) {
    176 			((GL10)mGL).glDeleteTextures(n, textures);
    177 			checkError();
    178 		}
    179 
    180 		public void glDeleteTextures(int n, int[] textures, int offset) {
    181 			((GL10)mGL).glDeleteTextures(n, textures, offset);
    182 			checkError();
    183 		}
    184 
    185 		public void glDepthFunc(int func) {
    186 			((GL10)mGL).glDepthFunc(func);
    187 			checkError();
    188 		}
    189 
    190 		public void glDepthMask(boolean flag) {
    191 			((GL10)mGL).glDepthMask(flag);
    192 			checkError();
    193 		}
    194 
    195 		public void glDepthRangef(float zNear, float zFar) {
    196 			((GL10)mGL).glDepthRangef(zNear, zFar);
    197 			checkError();
    198 		}
    199 
    200 		public void glDepthRangex(int zNear, int zFar) {
    201 			((GL10)mGL).glDepthRangex(zNear, zFar);
    202 			checkError();
    203 		}
    204 
    205 		public void glDisable(int cap) {
    206 			((GL10)mGL).glDisable(cap);
    207 			checkError();
    208 		}
    209 
    210 		public void glDisableClientState(int array) {
    211 			((GL10)mGL).glDisableClientState(array);
    212 			checkError();
    213 		}
    214 
    215 		public void glDrawArrays(int mode, int first, int count) {
    216 			((GL10)mGL).glDrawArrays(mode, first, count);
    217 			checkError();
    218 		}
    219 
    220 		public void glDrawElements(int mode, int count, int type, Buffer indices) {
    221 			((GL10)mGL).glDrawElements(mode, count, type, indices);
    222 			checkError();
    223 		}
    224 
    225 		public void glEnable(int cap) {
    226 			((GL10)mGL).glEnable(cap);
    227 			checkError();
    228 		}
    229 
    230 		public void glEnableClientState(int array) {
    231 			((GL10)mGL).glEnableClientState(array);
    232 			checkError();
    233 		}
    234 
    235 		public void glFinish() {
    236 			((GL10)mGL).glFinish();
    237 			checkError();
    238 		}
    239 
    240 		public void glFlush() {
    241 			((GL10)mGL).glFlush();
    242 			checkError();
    243 		}
    244 
    245 		public void glFogf(int pname, float param) {
    246 			((GL10)mGL).glFogf(pname, param);
    247 			checkError();
    248 		}
    249 
    250 		public void glFogfv(int pname, FloatBuffer params) {
    251 			((GL10)mGL).glFogfv(pname, params);
    252 			checkError();
    253 		}
    254 
    255 		public void glFogfv(int pname, float[] params, int offset) {
    256 			((GL10)mGL).glFogfv(pname, params, offset);
    257 			checkError();
    258 		}
    259 
    260 		public void glFogx(int pname, int param) {
    261 			((GL10)mGL).glFogx(pname, param);
    262 			checkError();
    263 		}
    264 
    265 		public void glFogxv(int pname, IntBuffer params) {
    266 			((GL10)mGL).glFogxv(pname, params);
    267 			checkError();
    268 		}
    269 
    270 		public void glFogxv(int pname, int[] params, int offset) {
    271 			((GL10)mGL).glFogxv(pname, params, offset);
    272 			checkError();
    273 		}
    274 
    275 		public void glFrontFace(int mode) {
    276 			((GL10)mGL).glFrontFace(mode);
    277 			checkError();
    278 		}
    279 
    280 		public void glFrustumf(float left, float right, float bottom,
    281 				float top, float zNear, float zFar) {
    282 			((GL10)mGL).glFrustumf( left,  right,  bottom,
    283 					 top,  zNear,  zFar);
    284 			checkError();
    285 		}
    286 
    287 		public void glFrustumx(int left, int right, int bottom, int top,
    288 				int zNear, int zFar) {
    289 			((GL10)mGL).glFrustumx( left,  right,  bottom,  top,
    290 					 zNear,  zFar);
    291 			checkError();
    292 		}
    293 
    294 		public void glGenTextures(int n, IntBuffer textures) {
    295 			((GL10)mGL).glGenTextures(n, textures);
    296 			checkError();
    297 		}
    298 
    299 		public void glGenTextures(int n, int[] textures, int offset) {
    300 			((GL10)mGL).glGenTextures(n, textures, offset);
    301 			checkError();
    302 		}
    303 
    304 		public int glGetError() {
    305 			return ((GL10)mGL).glGetError();
    306 		}
    307 
    308 		public void glGetIntegerv(int pname, IntBuffer params) {
    309 			((GL10)mGL).glGetIntegerv(pname, params);
    310 			checkError();
    311 		}
    312 
    313 		public void glGetIntegerv(int pname, int[] params, int offset) {
    314 			((GL10)mGL).glGetIntegerv(pname, params, offset);
    315 			checkError();
    316 		}
    317 
    318 		public String glGetString(int name) {
    319 			String result = ((GL10)mGL).glGetString(name);
    320 			checkError();
    321 			return result;
    322 		}
    323 
    324 		public void glHint(int target, int mode) {
    325 			((GL10)mGL).glHint(target, mode);
    326 			checkError();
    327 		}
    328 
    329 		public void glLightModelf(int pname, float param) {
    330 			((GL10)mGL).glLightModelf(pname, param);
    331 			checkError();
    332 		}
    333 
    334 		public void glLightModelfv(int pname, FloatBuffer params) {
    335 			((GL10)mGL).glLightModelfv(pname, params);
    336 			checkError();
    337 		}
    338 
    339 		public void glLightModelfv(int pname, float[] params, int offset) {
    340 			((GL10)mGL).glLightModelfv(pname, params, offset);
    341 			checkError();
    342 		}
    343 
    344 		public void glLightModelx(int pname, int param) {
    345 			((GL10)mGL).glLightModelx(pname, param);
    346 			checkError();
    347 		}
    348 
    349 		public void glLightModelxv(int pname, IntBuffer params) {
    350 			((GL10)mGL).glLightModelxv(pname, params);
    351 			checkError();
    352 		}
    353 
    354 		public void glLightModelxv(int pname, int[] params, int offset) {
    355 			((GL10)mGL).glLightModelxv(pname, params, offset);
    356 			checkError();
    357 		}
    358 
    359 		public void glLightf(int light, int pname, float param) {
    360 			((GL10)mGL).glLightf(light, pname, param);
    361 			checkError();
    362 		}
    363 
    364 		public void glLightfv(int light, int pname, FloatBuffer params) {
    365 			((GL10)mGL).glLightfv(light, pname, params);
    366 			checkError();
    367 		}
    368 
    369 		public void glLightfv(int light, int pname, float[] params, int offset) {
    370 			((GL10)mGL).glLightfv(light, pname, params, offset);
    371 			checkError();
    372 		}
    373 
    374 		public void glLightx(int light, int pname, int param) {
    375 			((GL10)mGL).glLightx(light, pname, param);
    376 			checkError();
    377 		}
    378 
    379 		public void glLightxv(int light, int pname, IntBuffer params) {
    380 			((GL10)mGL).glLightxv(light, pname, params);
    381 			checkError();
    382 		}
    383 
    384 		public void glLightxv(int light, int pname, int[] params, int offset) {
    385 			((GL10)mGL).glLightxv(light, pname, params, offset);
    386 			checkError();
    387 		}
    388 
    389 		public void glLineWidth(float width) {
    390 			((GL10)mGL).glLineWidth(width);
    391 			checkError();
    392 		}
    393 
    394 		public void glLineWidthx(int width) {
    395 			((GL10)mGL).glLineWidthx(width);
    396 			checkError();
    397 		}
    398 
    399 		public void glLoadIdentity() {
    400 			((GL10)mGL).glLoadIdentity();
    401 			checkError();
    402 		}
    403 
    404 		public void glLoadMatrixf(FloatBuffer m) {
    405 			((GL10)mGL).glLoadMatrixf(m);
    406 			checkError();
    407 		}
    408 
    409 		public void glLoadMatrixf(float[] m, int offset) {
    410 			((GL10)mGL).glLoadMatrixf(m, offset);
    411 			checkError();
    412 		}
    413 
    414 		public void glLoadMatrixx(IntBuffer m) {
    415 			((GL10)mGL).glLoadMatrixx(m);
    416 			checkError();
    417 		}
    418 
    419 		public void glLoadMatrixx(int[] m, int offset) {
    420 			((GL10)mGL).glLoadMatrixx(m, offset);
    421 			checkError();
    422 		}
    423 
    424 		public void glLogicOp(int opcode) {
    425 			((GL10)mGL).glLogicOp(opcode);
    426 			checkError();
    427 		}
    428 
    429 		public void glMaterialf(int face, int pname, float param) {
    430 			((GL10)mGL).glMaterialf(face, pname, param);
    431 			checkError();
    432 		}
    433 
    434 		public void glMaterialfv(int face, int pname, FloatBuffer params) {
    435 			((GL10)mGL).glMaterialfv(face, pname, params);
    436 			checkError();
    437 		}
    438 
    439 		public void glMaterialfv(int face, int pname, float[] params, int offset) {
    440 			((GL10)mGL).glMaterialfv(face, pname, params, offset);
    441 			checkError();
    442 		}
    443 
    444 		public void glMaterialx(int face, int pname, int param) {
    445 			((GL10)mGL).glMaterialx(face, pname, param);
    446 			checkError();
    447 		}
    448 
    449 		public void glMaterialxv(int face, int pname, IntBuffer params) {
    450 			((GL10)mGL).glMaterialxv(face, pname, params);
    451 			checkError();
    452 		}
    453 
    454 		public void glMaterialxv(int face, int pname, int[] params, int offset) {
    455 			((GL10)mGL).glMaterialxv(face, pname, params, offset);
    456 			checkError();
    457 		}
    458 
    459 		public void glMatrixMode(int mode) {
    460 			((GL10)mGL).glMatrixMode(mode);
    461 			checkError();
    462 		}
    463 
    464 		public void glMultMatrixf(FloatBuffer m) {
    465 			((GL10)mGL).glMultMatrixf(m);
    466 			checkError();
    467 		}
    468 
    469 		public void glMultMatrixf(float[] m, int offset) {
    470 			((GL10)mGL).glMultMatrixf(m, offset);
    471 			checkError();
    472 		}
    473 
    474 		public void glMultMatrixx(IntBuffer m) {
    475 			((GL10)mGL).glMultMatrixx(m);
    476 			checkError();
    477 		}
    478 
    479 		public void glMultMatrixx(int[] m, int offset) {
    480 			((GL10)mGL).glMultMatrixx(m, offset);
    481 			checkError();
    482 		}
    483 
    484 		public void glMultiTexCoord4f(int target, float s, float t, float r,
    485 				float q) {
    486 			((GL10)mGL).glMultiTexCoord4f( target,  s,  t,  r, q);
    487 			checkError();
    488 		}
    489 
    490 		public void glMultiTexCoord4x(int target, int s, int t, int r, int q) {
    491 			((GL10)mGL).glMultiTexCoord4x( target,  s,  t,  r,  q);
    492 			checkError();
    493 		}
    494 
    495 		public void glNormal3f(float nx, float ny, float nz) {
    496 			((GL10)mGL).glNormal3f(nx, ny, nz);
    497 			checkError();
    498 		}
    499 
    500 		public void glNormal3x(int nx, int ny, int nz) {
    501 			((GL10)mGL).glNormal3x(nx, ny, nz);
    502 			checkError();
    503 		}
    504 
    505 		public void glNormalPointer(int type, int stride, Buffer pointer) {
    506 			((GL10)mGL).glNormalPointer(type, stride, pointer);
    507 			checkError();
    508 		}
    509 
    510 		public void glOrthof(float left, float right, float bottom, float top,
    511 				float zNear, float zFar) {
    512 			((GL10)mGL).glOrthof( left,  right,  bottom,  top,
    513 					 zNear,  zFar);
    514 			checkError();
    515 		}
    516 
    517 		public void glOrthox(int left, int right, int bottom, int top,
    518 				int zNear, int zFar) {
    519 			((GL10)mGL).glOrthox( left,  right,  bottom,  top,
    520 					 zNear,  zFar);
    521 			checkError();
    522 		}
    523 
    524 		public void glPixelStorei(int pname, int param) {
    525 			((GL10)mGL).glPixelStorei(pname, param);
    526 			checkError();
    527 		}
    528 
    529 		public void glPointSize(float size) {
    530 			((GL10)mGL).glPointSize(size);
    531 			checkError();
    532 		}
    533 
    534 		public void glPointSizex(int size) {
    535 			((GL10)mGL).glPointSizex(size);
    536 			checkError();
    537 		}
    538 
    539 		public void glPolygonOffset(float factor, float units) {
    540 			((GL10)mGL).glPolygonOffset(factor, units);
    541 			checkError();
    542 		}
    543 
    544 		public void glPolygonOffsetx(int factor, int units) {
    545 			((GL10)mGL).glPolygonOffsetx(factor, units);
    546 			checkError();
    547 		}
    548 
    549 		public void glPopMatrix() {
    550 			((GL10)mGL).glPopMatrix();
    551 			checkError();
    552 		}
    553 
    554 		public void glPushMatrix() {
    555 			((GL10)mGL).glPushMatrix();
    556 			checkError();
    557 		}
    558 
    559 		public void glReadPixels(int x, int y, int width, int height,
    560 				int format, int type, Buffer pixels) {
    561 			((GL10)mGL).glReadPixels( x,  y,  width,  height,
    562 					 format,  type,  pixels);
    563 			checkError();
    564 		}
    565 
    566 		public void glRotatef(float angle, float x, float y, float z) {
    567 			((GL10)mGL).glRotatef(angle, x, y, z);
    568 			checkError();
    569 		}
    570 
    571 		public void glRotatex(int angle, int x, int y, int z) {
    572 			((GL10)mGL).glRotatex(angle, x, y, z);
    573 			checkError();
    574 		}
    575 
    576 		public void glSampleCoverage(float value, boolean invert) {
    577 			((GL10)mGL).glSampleCoverage(value, invert);
    578 			checkError();
    579 		}
    580 
    581 		public void glSampleCoveragex(int value, boolean invert) {
    582 			((GL10)mGL).glSampleCoveragex(value, invert);
    583 			checkError();
    584 		}
    585 
    586 		public void glScalef(float x, float y, float z) {
    587 			((GL10)mGL).glScalef(x, y, z);
    588 			checkError();
    589 		}
    590 
    591 		public void glScalex(int x, int y, int z) {
    592 			((GL10)mGL).glScalex(x, y, z);
    593 			checkError();
    594 		}
    595 
    596 		public void glScissor(int x, int y, int width, int height) {
    597 			((GL10)mGL).glScissor(x, y, width, height);
    598 			checkError();
    599 		}
    600 
    601 		public void glShadeModel(int mode) {
    602 			((GL10)mGL).glShadeModel(mode);
    603 			checkError();
    604 		}
    605 
    606 		public void glStencilFunc(int func, int ref, int mask) {
    607 			((GL10)mGL).glStencilFunc(func, ref, mask);
    608 			checkError();
    609 		}
    610 
    611 		public void glStencilMask(int mask) {
    612 			((GL10)mGL).glStencilMask(mask);
    613 			checkError();
    614 		}
    615 
    616 		public void glStencilOp(int fail, int zfail, int zpass) {
    617 			((GL10)mGL).glStencilOp(fail, zfail, zpass);
    618 			checkError();
    619 		}
    620 
    621 		public void glTexCoordPointer(int size, int type, int stride,
    622 				Buffer pointer) {
    623 			((GL10)mGL).glTexCoordPointer( size,  type,  stride,
    624 					pointer);
    625 			checkError();
    626 		}
    627 
    628 		public void glTexEnvf(int target, int pname, float param) {
    629 			((GL10)mGL).glTexEnvf(target, pname, param);
    630 			checkError();
    631 		}
    632 
    633 		public void glTexEnvfv(int target, int pname, FloatBuffer params) {
    634 			((GL10)mGL).glTexEnvfv(target, pname, params);
    635 			checkError();
    636 		}
    637 
    638 		public void glTexEnvfv(int target, int pname, float[] params, int offset) {
    639 			((GL10)mGL).glTexEnvfv(target, pname, params, offset);
    640 			checkError();
    641 		}
    642 
    643 		public void glTexEnvx(int target, int pname, int param) {
    644 			((GL10)mGL).glTexEnvx(target, pname, param);
    645 			checkError();
    646 		}
    647 
    648 		public void glTexEnvxv(int target, int pname, IntBuffer params) {
    649 			((GL10)mGL).glTexEnvxv(target, pname, params);
    650 			checkError();
    651 		}
    652 
    653 		public void glTexEnvxv(int target, int pname, int[] params, int offset) {
    654 			((GL10)mGL).glTexEnvxv(target, pname, params, offset);
    655 			checkError();
    656 		}
    657 
    658 		public void glTexImage2D(int target, int level, int internalformat,
    659 				int width, int height, int border, int format, int type,
    660 				Buffer pixels) {
    661 			((GL10)mGL).glTexImage2D( target,  level,  internalformat,
    662 					 width,  height,  border,  format,  type,
    663 					 pixels);
    664 			checkError();
    665 		}
    666 
    667 		public void glTexParameterf(int target, int pname, float param) {
    668 			((GL10)mGL).glTexParameterf(target, pname, param);
    669 			checkError();
    670 		}
    671 
    672 		public void glTexParameterx(int target, int pname, int param) {
    673 			((GL10)mGL).glTexParameterx(target, pname, param);
    674 			checkError();
    675 		}
    676 
    677 		public void glTexSubImage2D(int target, int level, int xoffset,
    678 				int yoffset, int width, int height, int format, int type,
    679 				Buffer pixels) {
    680 			((GL10)mGL).glTexSubImage2D( target,  level,  xoffset,
    681 					 yoffset,  width,  height,  format,  type,
    682 					 pixels);
    683 			checkError();
    684 		}
    685 
    686 		public void glTranslatef(float x, float y, float z) {
    687 			((GL10)mGL).glTranslatef(x, y, z);
    688 			checkError();
    689 		}
    690 
    691 		public void glTranslatex(int x, int y, int z) {
    692 			((GL10)mGL).glTranslatex(x, y, z);
    693 			checkError();
    694 		}
    695 
    696 		public void glVertexPointer(int size, int type, int stride,
    697 				Buffer pointer) {
    698 			((GL10)mGL).glVertexPointer( size,  type,  stride,
    699 					 pointer);
    700 			checkError();
    701 		}
    702 
    703 		public void glViewport(int x, int y, int width, int height) {
    704 			((GL10)mGL).glViewport(x, y, width, height);
    705 			checkError();
    706 		}
    707 
    708 		public void glBindBuffer(int arg0, int arg1) {
    709 			((GL11)mGL).glBindBuffer(arg0, arg1);
    710 			checkError();
    711 		}
    712 
    713 		public void glBufferData(int arg0, int arg1, Buffer arg2, int arg3) {
    714 			((GL11)mGL).glBufferData(arg0, arg1, arg2, arg3);
    715 			checkError();
    716 		}
    717 
    718 		public void glBufferSubData(int arg0, int arg1, int arg2, Buffer arg3) {
    719 			((GL11)mGL).glBufferSubData(arg0, arg1, arg2, arg3);
    720 			checkError();
    721 		}
    722 
    723 		public void glClipPlanef(int arg0, FloatBuffer arg1) {
    724 			((GL11)mGL).glClipPlanef(arg0, arg1);
    725 			checkError();
    726 		}
    727 
    728 		public void glClipPlanef(int arg0, float[] arg1, int arg2) {
    729 			((GL11)mGL).glClipPlanef(arg0, arg1, arg2);
    730 			checkError();
    731 		}
    732 
    733 		public void glClipPlanex(int arg0, IntBuffer arg1) {
    734 			((GL11)mGL).glClipPlanex(arg0, arg1);
    735 			checkError();
    736 		}
    737 
    738 		public void glClipPlanex(int arg0, int[] arg1, int arg2) {
    739 			((GL11)mGL).glClipPlanex(arg0, arg1, arg2);
    740 			checkError();
    741 		}
    742 
    743 		public void glColor4ub(byte arg0, byte arg1, byte arg2, byte arg3) {
    744 			((GL11)mGL).glColor4ub(arg0, arg1, arg2, arg3);
    745 			checkError();
    746 		}
    747 
    748 		public void glColorPointer(int arg0, int arg1, int arg2, int arg3) {
    749 			((GL11)mGL).glColorPointer(arg0, arg1, arg2, arg3);
    750 			checkError();
    751 		}
    752 
    753 		public void glDeleteBuffers(int n, IntBuffer buffers) {
    754 			((GL11)mGL).glDeleteBuffers(n, buffers);
    755 			checkError();
    756 		}
    757 
    758 		public void glDeleteBuffers(int n, int[] buffers, int offset) {
    759 			((GL11)mGL).glDeleteBuffers(n, buffers, offset);
    760 			checkError();
    761 		}
    762 
    763 		public void glDrawElements(int mode, int count, int type, int offset) {
    764 			((GL11)mGL).glDrawElements(mode, count, type, offset);
    765 			checkError();
    766 		}
    767 
    768 		public void glGenBuffers(int n, IntBuffer buffers) {
    769 			((GL11)mGL).glGenBuffers(n, buffers);
    770 			checkError();
    771 		}
    772 
    773 		public void glGenBuffers(int n, int[] buffers, int offset) {
    774 			((GL11)mGL).glGenBuffers(n, buffers, offset);
    775 			checkError();
    776 		}
    777 
    778 		public void glGetBooleanv(int pname, IntBuffer params) {
    779 			((GL11)mGL).glGetBooleanv(pname, params);
    780 			checkError();
    781 		}
    782 
    783 		public void glGetBooleanv(int pname, boolean[] params, int offset) {
    784 			((GL11)mGL).glGetBooleanv(pname, params, offset);
    785 			checkError();
    786 		}
    787 
    788 		public void glGetBufferParameteriv(int target, int pname,
    789 				IntBuffer params) {
    790 			((GL11)mGL).glGetBufferParameteriv( target,  pname,
    791 					 params);
    792 			checkError();
    793 		}
    794 
    795 		public void glGetBufferParameteriv(int target, int pname, int[] params,
    796 				int offset) {
    797 			((GL11)mGL).glGetBufferParameteriv( target,  pname, params,
    798 					 offset);
    799 			checkError();
    800 		}
    801 
    802 		public void glGetClipPlanef(int pname, FloatBuffer eqn) {
    803 			((GL11)mGL).glGetClipPlanef(pname, eqn);
    804 			checkError();
    805 		}
    806 
    807 		public void glGetClipPlanef(int pname, float[] eqn, int offset) {
    808 			((GL11)mGL).glGetClipPlanef(pname, eqn, offset);
    809 			checkError();
    810 		}
    811 
    812 		public void glGetClipPlanex(int pname, IntBuffer eqn) {
    813 			((GL11)mGL).glGetClipPlanex(pname, eqn);
    814 			checkError();
    815 		}
    816 
    817 		public void glGetClipPlanex(int pname, int[] eqn, int offset) {
    818 			((GL11)mGL).glGetClipPlanex(pname, eqn, offset);
    819 			checkError();
    820 		}
    821 
    822 		public void glGetFixedv(int pname, IntBuffer params) {
    823 			((GL11)mGL).glGetFixedv(pname, params);
    824 			checkError();
    825 		}
    826 
    827 		public void glGetFixedv(int pname, int[] params, int offset) {
    828 			((GL11)mGL).glGetFixedv(pname, params, offset);
    829 			checkError();
    830 		}
    831 
    832 		public void glGetFloatv(int pname, FloatBuffer params) {
    833 			((GL11)mGL).glGetFloatv(pname, params);
    834 			checkError();
    835 		}
    836 
    837 		public void glGetFloatv(int pname, float[] params, int offset) {
    838 			((GL11)mGL).glGetFloatv(pname, params, offset);
    839 			checkError();
    840 		}
    841 
    842 		public void glGetLightfv(int light, int pname, FloatBuffer params) {
    843 			((GL11)mGL).glGetLightfv(light, pname, params);
    844 			checkError();
    845 		}
    846 
    847 		public void glGetLightfv(int light, int pname, float[] params,
    848 				int offset) {
    849 			((GL11)mGL).glGetLightfv( light,  pname,  params,
    850 					 offset);
    851 			checkError();
    852 		}
    853 
    854 		public void glGetLightxv(int light, int pname, IntBuffer params) {
    855 			((GL11)mGL).glGetLightxv(light, pname, params);
    856 			checkError();
    857 		}
    858 
    859 		public void glGetLightxv(int light, int pname, int[] params, int offset) {
    860 			((GL11)mGL).glGetLightxv(light, pname, params, offset);
    861 			checkError();
    862 		}
    863 
    864 		public void glGetMaterialfv(int face, int pname, FloatBuffer params) {
    865 			((GL11)mGL).glGetMaterialfv(face, pname, params);
    866 			checkError();
    867 		}
    868 
    869 		public void glGetMaterialfv(int face, int pname, float[] params,
    870 				int offset) {
    871 			((GL11)mGL).glGetMaterialfv( face,  pname,  params,
    872 					 offset);
    873 			checkError();
    874 		}
    875 
    876 		public void glGetMaterialxv(int face, int pname, IntBuffer params) {
    877 			((GL11)mGL).glGetMaterialxv(face, pname, params);
    878 			checkError();
    879 		}
    880 
    881 		public void glGetMaterialxv(int face, int pname, int[] params,
    882 				int offset) {
    883 			((GL11)mGL).glGetMaterialxv( face,  pname, params,
    884 					 offset);
    885 			checkError();
    886 		}
    887 
    888 		public void glGetPointerv(int pname, Buffer[] params) {
    889 			((GL11)mGL).glGetPointerv(pname, params);
    890 			checkError();
    891 		}
    892 
    893 		public void glGetTexEnviv(int env, int pname, IntBuffer params) {
    894 			((GL11)mGL).glGetTexEnviv(env, pname, params);
    895 			checkError();
    896 		}
    897 
    898 		public void glGetTexEnviv(int env, int pname, int[] params, int offset) {
    899 			((GL11)mGL).glGetTexEnviv(env, pname, params, offset);
    900 			checkError();
    901 		}
    902 
    903 		public void glGetTexEnvxv(int env, int pname, IntBuffer params) {
    904 			((GL11)mGL).glGetTexEnvxv(env, pname, params);
    905 			checkError();
    906 		}
    907 
    908 		public void glGetTexEnvxv(int env, int pname, int[] params, int offset) {
    909 			((GL11)mGL).glGetTexEnvxv(env, pname, params, offset);
    910 			checkError();
    911 		}
    912 
    913 		public void glGetTexParameterfv(int target, int pname,
    914 				FloatBuffer params) {
    915 			((GL11)mGL).glGetTexParameterfv( target,  pname,
    916 					 params);
    917 			checkError();
    918 		}
    919 
    920 		public void glGetTexParameterfv(int target, int pname, float[] params,
    921 				int offset) {
    922 			((GL11)mGL).glGetTexParameterfv( target,  pname, params,
    923 					 offset);
    924 			checkError();
    925 		}
    926 
    927 		public void glGetTexParameteriv(int target, int pname, IntBuffer params) {
    928 			((GL11)mGL).glGetTexParameteriv(target, pname, params);
    929 			checkError();
    930 		}
    931 
    932 		public void glGetTexParameteriv(int target, int pname, int[] params,
    933 				int offset) {
    934 			((GL11)mGL).glGetTexParameteriv( target,  pname,  params,
    935 					 offset);
    936 			checkError();
    937 		}
    938 
    939 		public void glGetTexParameterxv(int target, int pname, IntBuffer params) {
    940 			((GL11)mGL).glGetTexParameterxv(target, pname, params);
    941 			checkError();
    942 		}
    943 
    944 		public void glGetTexParameterxv(int target, int pname, int[] params,
    945 				int offset) {
    946 			((GL11)mGL).glGetTexParameterxv( target,  pname, params,
    947 					 offset);
    948 			checkError();
    949 		}
    950 
    951 		public boolean glIsBuffer(int buffer) {
    952 			boolean result = ((GL11)mGL).glIsBuffer( buffer);
    953 			checkError();
    954 			return result;
    955 		}
    956 
    957 		public boolean glIsEnabled(int cap) {
    958 			boolean result = ((GL11)mGL).glIsEnabled(cap);
    959 			checkError();
    960 			return result;
    961 		}
    962 
    963 		public boolean glIsTexture(int texture) {
    964 			boolean result = ((GL11)mGL).glIsTexture( texture);
    965 			checkError();
    966 			return result;
    967 		}
    968 
    969 		public void glNormalPointer(int type, int stride, int offset) {
    970 			((GL11)mGL).glNormalPointer(type, stride, offset);
    971 			checkError();
    972 		}
    973 
    974 		public void glPointParameterf(int pname, float param) {
    975 			((GL11)mGL).glPointParameterf(pname, param);
    976 			checkError();
    977 		}
    978 
    979 		public void glPointParameterfv(int pname, FloatBuffer params) {
    980 			((GL11)mGL).glPointParameterfv(pname, params);
    981 			checkError();
    982 		}
    983 
    984 		public void glPointParameterfv(int pname, float[] params, int offset) {
    985 			((GL11)mGL).glPointParameterfv(pname, params, offset);
    986 			checkError();
    987 		}
    988 
    989 		public void glPointParameterx(int pname, int param) {
    990 			((GL11)mGL).glPointParameterx(pname, param);
    991 			checkError();
    992 		}
    993 
    994 		public void glPointParameterxv(int pname, IntBuffer params) {
    995 			((GL11)mGL).glPointParameterxv(pname, params);
    996 			checkError();
    997 		}
    998 
    999 		public void glPointParameterxv(int pname, int[] params, int offset) {
   1000 			((GL11)mGL).glPointParameterxv(pname, params, offset);
   1001 			checkError();
   1002 		}
   1003 
   1004 		public void glPointSizePointerOES(int type, int stride, Buffer pointer) {
   1005 			((GL11)mGL).glPointSizePointerOES(type, stride, pointer);
   1006 			checkError();
   1007 		}
   1008 
   1009 		public void glTexCoordPointer(int size, int type, int stride, int offset) {
   1010 			((GL11)mGL).glTexCoordPointer(size, type, stride, offset);
   1011 			checkError();
   1012 		}
   1013 
   1014 		public void glTexEnvi(int target, int pname, int param) {
   1015 			((GL11)mGL).glTexEnvi(target, pname, param);
   1016 			checkError();
   1017 		}
   1018 
   1019 		public void glTexEnviv(int target, int pname, IntBuffer params) {
   1020 			((GL11)mGL).glTexEnviv(target, pname, params);
   1021 			checkError();
   1022 		}
   1023 
   1024 		public void glTexEnviv(int target, int pname, int[] params, int offset) {
   1025 			((GL11)mGL).glTexEnviv(target, pname, params, offset);
   1026 			checkError();
   1027 		}
   1028 
   1029 		public void glTexParameterfv(int target, int pname, FloatBuffer params) {
   1030 			((GL11)mGL).glTexParameterfv(target, pname, params);
   1031 			checkError();
   1032 		}
   1033 
   1034 		public void glTexParameterfv(int target, int pname, float[] params,
   1035 				int offset) {
   1036 			((GL11)mGL).glTexParameterfv( target,  pname,  params,
   1037 					 offset);
   1038 			checkError();
   1039 		}
   1040 
   1041 		public void glTexParameteri(int target, int pname, int param) {
   1042 			((GL11)mGL).glTexParameteri(target, pname, param);
   1043 			checkError();
   1044 		}
   1045 
   1046 		public void glTexParameteriv(int target, int pname, IntBuffer params) {
   1047 			((GL11)mGL).glTexParameteriv(target, pname, params);
   1048 			checkError();
   1049 		}
   1050 
   1051 		public void glTexParameteriv(int target, int pname, int[] params,
   1052 				int offset) {		}
   1053 
   1054 		public void glTexParameterxv(int target, int pname, IntBuffer params) {
   1055 			((GL11)mGL).glTexParameterxv(target, pname, params);
   1056 			checkError();
   1057 		}
   1058 
   1059 		public void glTexParameterxv(int target, int pname, int[] params,
   1060 				int offset) {
   1061 			((GL11)mGL).glTexParameterxv( target,  pname,  params,
   1062 					 offset);
   1063 			checkError();
   1064 		}
   1065 
   1066 		public void glVertexPointer(int size, int type, int stride, int offset) {
   1067 			((GL11)mGL).glVertexPointer(size, type, stride, offset);
   1068 			checkError();
   1069 		}
   1070 
   1071 	    public void glCurrentPaletteMatrixOES(int matrixpaletteindex) {
   1072 			((GL11Ext)mGL).glCurrentPaletteMatrixOES(matrixpaletteindex);
   1073 			checkError();
   1074 	    }
   1075 
   1076 		public void glDrawTexfOES(float x, float y, float z, float width,
   1077 				float height) {
   1078 			((GL11Ext)mGL).glDrawTexfOES( x,  y,  z,  width,
   1079 					 height);
   1080 			checkError();
   1081 		}
   1082 
   1083 		public void glDrawTexfvOES(FloatBuffer coords) {
   1084 			((GL11Ext)mGL).glDrawTexfvOES(coords);
   1085 			checkError();
   1086 		}
   1087 
   1088 		public void glDrawTexfvOES(float[] coords, int offset) {
   1089 			((GL11Ext)mGL).glDrawTexfvOES(coords, offset);
   1090 			checkError();
   1091 		}
   1092 
   1093 		public void glDrawTexiOES(int x, int y, int z, int width, int height) {
   1094 			((GL11Ext)mGL).glDrawTexiOES( x,  y,  z,  width,  height);
   1095 			checkError();
   1096 		}
   1097 
   1098 		public void glDrawTexivOES(IntBuffer coords) {
   1099 			((GL11Ext)mGL).glDrawTexivOES(coords);
   1100 			checkError();
   1101 
   1102 
   1103 		}
   1104 
   1105 		public void glDrawTexivOES(int[] coords, int offset) {
   1106 			((GL11Ext)mGL).glDrawTexivOES(coords, offset);
   1107 			checkError();
   1108 
   1109 
   1110 		}
   1111 
   1112 		public void glDrawTexsOES(short x, short y, short z, short width,
   1113 				short height) {
   1114 			((GL11Ext)mGL).glDrawTexsOES( x,  y,  z,  width,
   1115 					 height);
   1116 			checkError();
   1117 		}
   1118 
   1119 		public void glDrawTexsvOES(ShortBuffer coords) {
   1120 			((GL11Ext)mGL).glDrawTexsvOES(coords);
   1121 			checkError();
   1122 
   1123 
   1124 		}
   1125 
   1126 		public void glDrawTexsvOES(short[] coords, int offset) {
   1127 			((GL11Ext)mGL).glDrawTexsvOES(coords, offset);
   1128 			checkError();
   1129 
   1130 
   1131 		}
   1132 
   1133 		public void glDrawTexxOES(int x, int y, int z, int width, int height) {
   1134 			((GL11Ext)mGL).glDrawTexxOES( x,  y,  z,  width,  height);
   1135 			checkError();
   1136 		}
   1137 
   1138 		public void glDrawTexxvOES(IntBuffer coords) {
   1139 			((GL11Ext)mGL).glDrawTexxvOES(coords);
   1140 			checkError();
   1141 
   1142 
   1143 		}
   1144 
   1145 		public void glDrawTexxvOES(int[] coords, int offset) {
   1146 			((GL11Ext)mGL).glDrawTexxvOES(coords, offset);
   1147 			checkError();
   1148 
   1149 
   1150 		}
   1151 
   1152 		public void glLoadPaletteFromModelViewMatrixOES() {
   1153 			((GL11Ext)mGL).glLoadPaletteFromModelViewMatrixOES();
   1154 			checkError();
   1155 
   1156 
   1157 		}
   1158 
   1159 		public void glMatrixIndexPointerOES(int size, int type, int stride,
   1160 				Buffer pointer) {
   1161 			((GL11Ext)mGL).glMatrixIndexPointerOES( size,  type,  stride,
   1162 					 pointer);
   1163 			checkError();
   1164 
   1165 		}
   1166 
   1167 		public void glMatrixIndexPointerOES(int size, int type, int stride,
   1168 				int offset) {
   1169 			((GL11Ext)mGL).glMatrixIndexPointerOES( size,  type,  stride,
   1170 					 offset);
   1171 			checkError();
   1172 		}
   1173 
   1174 		public void glWeightPointerOES(int size, int type, int stride,
   1175 				Buffer pointer) {
   1176 			((GL11Ext)mGL).glWeightPointerOES( size,  type,  stride,
   1177 					 pointer);
   1178 			checkError();
   1179 		}
   1180 
   1181 		public void glWeightPointerOES(int size, int type, int stride,
   1182 				int offset) {
   1183 			((GL11Ext)mGL).glWeightPointerOES( size,  type,  stride,
   1184 					 offset);
   1185 			checkError();
   1186 		}
   1187 
   1188 		public int glQueryMatrixxOES(IntBuffer arg0, IntBuffer arg1) {
   1189 			int result = ((GL10Ext)mGL).glQueryMatrixxOES( arg0,  arg1);
   1190 			checkError();
   1191 			return result;
   1192 		}
   1193 
   1194 		public int glQueryMatrixxOES(int[] arg0, int arg1, int[] arg2, int arg3) {
   1195 			int result = ((GL10Ext)mGL).glQueryMatrixxOES(arg0, arg1,arg2, arg3);
   1196 			checkError();
   1197 			return result;
   1198 		}
   1199 	}
   1200 }
   1201