GLErrorWrapper.java revision 54b6cfa9a9e5b861a9930af873580d6dc20f773c
1/*
2 * Copyright (C) 2007 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
17package android.opengl;
18
19import java.nio.Buffer;
20import java.nio.FloatBuffer;
21import java.nio.IntBuffer;
22import java.nio.ShortBuffer;
23
24import javax.microedition.khronos.opengles.GL;
25
26/**
27 * Implement an error checking wrapper. The wrapper will automatically call
28     * glError after each GL operation, and throw a GLException if an error
29     * occurs. (By design, calling glError itself will not cause an exception
30     * to be thrown.) Enabling error checking is an alternative to manually
31     *  calling glError after every GL operation.
32 */
33class GLErrorWrapper extends GLWrapperBase {
34    boolean mCheckError;
35    boolean mCheckThread;
36    Thread mOurThread;
37
38    public GLErrorWrapper(GL gl, int configFlags) {
39        super(gl);
40        mCheckError = (configFlags & GLDebugHelper.CONFIG_CHECK_GL_ERROR) != 0;
41        mCheckThread = (configFlags & GLDebugHelper.CONFIG_CHECK_THREAD) != 0;
42    }
43
44    private void checkThread() {
45        if (mCheckThread) {
46            Thread currentThread = Thread.currentThread();
47            if (mOurThread == null) {
48                mOurThread = currentThread;
49            } else {
50                if (!mOurThread.equals(currentThread)) {
51                    throw new GLException(GLDebugHelper.ERROR_WRONG_THREAD,
52                            "OpenGL method called from wrong thread.");
53                }
54            }
55        }
56    }
57
58    private void checkError() {
59        if (mCheckError) {
60            int glError;
61            if ((glError = mgl.glGetError()) != 0) {
62                throw new GLException(glError);
63            }
64        }
65    }
66
67    // ---------------------------------------------------------------------
68    // GL10 methods:
69
70    public void glActiveTexture(int texture) {
71        checkThread();
72        mgl.glActiveTexture(texture);
73        checkError();
74    }
75
76    public void glAlphaFunc(int func, float ref) {
77        checkThread();
78        mgl.glAlphaFunc(func, ref);
79        checkError();
80    }
81
82    public void glAlphaFuncx(int func, int ref) {
83        checkThread();
84        mgl.glAlphaFuncx(func, ref);
85        checkError();
86    }
87
88    public void glBindTexture(int target, int texture) {
89        checkThread();
90        mgl.glBindTexture(target, texture);
91        checkError();
92    }
93
94    public void glBlendFunc(int sfactor, int dfactor) {
95        checkThread();
96        mgl.glBlendFunc(sfactor, dfactor);
97        checkError();
98    }
99
100    public void glClear(int mask) {
101        checkThread();
102        mgl.glClear(mask);
103        checkError();
104    }
105
106    public void glClearColor(float red, float green, float blue, float alpha) {
107        checkThread();
108        mgl.glClearColor(red, green, blue, alpha);
109        checkError();
110    }
111
112    public void glClearColorx(int red, int green, int blue, int alpha) {
113        checkThread();
114        mgl.glClearColorx(red, green, blue, alpha);
115        checkError();
116    }
117
118    public void glClearDepthf(float depth) {
119        checkThread();
120        mgl.glClearDepthf(depth);
121        checkError();
122    }
123
124    public void glClearDepthx(int depth) {
125        checkThread();
126        mgl.glClearDepthx(depth);
127        checkError();
128    }
129
130    public void glClearStencil(int s) {
131        checkThread();
132        mgl.glClearStencil(s);
133        checkError();
134    }
135
136    public void glClientActiveTexture(int texture) {
137        checkThread();
138        mgl.glClientActiveTexture(texture);
139        checkError();
140    }
141
142    public void glColor4f(float red, float green, float blue, float alpha) {
143        checkThread();
144        mgl.glColor4f(red, green, blue, alpha);
145        checkError();
146    }
147
148    public void glColor4x(int red, int green, int blue, int alpha) {
149        checkThread();
150        mgl.glColor4x(red, green, blue, alpha);
151        checkError();
152    }
153
154    public void glColorMask(boolean red, boolean green, boolean blue,
155            boolean alpha) {
156        checkThread();
157        mgl.glColorMask(red, green, blue, alpha);
158        checkError();
159    }
160
161    public void glColorPointer(int size, int type, int stride, Buffer pointer) {
162        checkThread();
163        mgl.glColorPointer(size, type, stride, pointer);
164        checkError();
165    }
166
167    public void glCompressedTexImage2D(int target, int level,
168            int internalformat, int width, int height, int border,
169            int imageSize, Buffer data) {
170        checkThread();
171        mgl.glCompressedTexImage2D(target, level, internalformat, width,
172                height, border, imageSize, data);
173        checkError();
174    }
175
176    public void glCompressedTexSubImage2D(int target, int level, int xoffset,
177            int yoffset, int width, int height, int format, int imageSize,
178            Buffer data) {
179        checkThread();
180        mgl.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width,
181                height, format, imageSize, data);
182        checkError();
183    }
184
185    public void glCopyTexImage2D(int target, int level, int internalformat,
186            int x, int y, int width, int height, int border) {
187        checkThread();
188        mgl.glCopyTexImage2D(target, level, internalformat, x, y, width,
189                height, border);
190        checkError();
191    }
192
193    public void glCopyTexSubImage2D(int target, int level, int xoffset,
194            int yoffset, int x, int y, int width, int height) {
195        checkThread();
196        mgl.glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width,
197                height);
198        checkError();
199    }
200
201    public void glCullFace(int mode) {
202        checkThread();
203        mgl.glCullFace(mode);
204        checkError();
205    }
206
207    public void glDeleteTextures(int n, int[] textures, int offset) {
208        checkThread();
209        mgl.glDeleteTextures(n, textures, offset);
210        checkError();
211    }
212
213    public void glDeleteTextures(int n, IntBuffer textures) {
214        checkThread();
215        mgl.glDeleteTextures(n, textures);
216        checkError();
217    }
218
219    public void glDepthFunc(int func) {
220        checkThread();
221        mgl.glDepthFunc(func);
222        checkError();
223    }
224
225    public void glDepthMask(boolean flag) {
226        checkThread();
227        mgl.glDepthMask(flag);
228        checkError();
229    }
230
231    public void glDepthRangef(float near, float far) {
232        checkThread();
233        mgl.glDepthRangef(near, far);
234        checkError();
235    }
236
237    public void glDepthRangex(int near, int far) {
238        checkThread();
239        mgl.glDepthRangex(near, far);
240        checkError();
241    }
242
243    public void glDisable(int cap) {
244        checkThread();
245        mgl.glDisable(cap);
246        checkError();
247    }
248
249    public void glDisableClientState(int array) {
250        checkThread();
251        mgl.glDisableClientState(array);
252        checkError();
253    }
254
255    public void glDrawArrays(int mode, int first, int count) {
256        checkThread();
257        mgl.glDrawArrays(mode, first, count);
258        checkError();
259    }
260
261    public void glDrawElements(int mode, int count, int type, Buffer indices) {
262        checkThread();
263        mgl.glDrawElements(mode, count, type, indices);
264        checkError();
265    }
266
267    public void glEnable(int cap) {
268        checkThread();
269        mgl.glEnable(cap);
270        checkError();
271    }
272
273    public void glEnableClientState(int array) {
274        checkThread();
275        mgl.glEnableClientState(array);
276        checkError();
277    }
278
279    public void glFinish() {
280        checkThread();
281        mgl.glFinish();
282        checkError();
283    }
284
285    public void glFlush() {
286        checkThread();
287        mgl.glFlush();
288        checkError();
289    }
290
291    public void glFogf(int pname, float param) {
292        checkThread();
293        mgl.glFogf(pname, param);
294        checkError();
295    }
296
297    public void glFogfv(int pname, float[] params, int offset) {
298        checkThread();
299        mgl.glFogfv(pname, params, offset);
300        checkError();
301    }
302
303    public void glFogfv(int pname, FloatBuffer params) {
304        checkThread();
305        mgl.glFogfv(pname, params);
306        checkError();
307    }
308
309    public void glFogx(int pname, int param) {
310        checkThread();
311        mgl.glFogx(pname, param);
312        checkError();
313    }
314
315    public void glFogxv(int pname, int[] params, int offset) {
316        checkThread();
317        mgl.glFogxv(pname, params, offset);
318        checkError();
319    }
320
321    public void glFogxv(int pname, IntBuffer params) {
322        checkThread();
323        mgl.glFogxv(pname, params);
324        checkError();
325    }
326
327    public void glFrontFace(int mode) {
328        checkThread();
329        mgl.glFrontFace(mode);
330        checkError();
331    }
332
333    public void glFrustumf(float left, float right, float bottom, float top,
334            float near, float far) {
335        checkThread();
336        mgl.glFrustumf(left, right, bottom, top, near, far);
337        checkError();
338    }
339
340    public void glFrustumx(int left, int right, int bottom, int top, int near,
341            int far) {
342        checkThread();
343        mgl.glFrustumx(left, right, bottom, top, near, far);
344        checkError();
345    }
346
347    public void glGenTextures(int n, int[] textures, int offset) {
348        checkThread();
349        mgl.glGenTextures(n, textures, offset);
350        checkError();
351    }
352
353    public void glGenTextures(int n, IntBuffer textures) {
354        checkThread();
355        mgl.glGenTextures(n, textures);
356        checkError();
357    }
358
359    public int glGetError() {
360        checkThread();
361        int result = mgl.glGetError();
362        return result;
363    }
364
365    public void glGetIntegerv(int pname, int[] params, int offset) {
366        checkThread();
367        mgl.glGetIntegerv(pname, params, offset);
368        checkError();
369    }
370
371    public void glGetIntegerv(int pname, IntBuffer params) {
372        checkThread();
373        mgl.glGetIntegerv(pname, params);
374        checkError();
375    }
376
377    public String glGetString(int name) {
378        checkThread();
379        String result = mgl.glGetString(name);
380        checkError();
381        return result;
382    }
383
384    public void glHint(int target, int mode) {
385        checkThread();
386        mgl.glHint(target, mode);
387        checkError();
388    }
389
390    public void glLightModelf(int pname, float param) {
391        checkThread();
392        mgl.glLightModelf(pname, param);
393        checkError();
394    }
395
396    public void glLightModelfv(int pname, float[] params, int offset) {
397        checkThread();
398        mgl.glLightModelfv(pname, params, offset);
399        checkError();
400    }
401
402    public void glLightModelfv(int pname, FloatBuffer params) {
403        checkThread();
404        mgl.glLightModelfv(pname, params);
405        checkError();
406    }
407
408    public void glLightModelx(int pname, int param) {
409        checkThread();
410        mgl.glLightModelx(pname, param);
411        checkError();
412    }
413
414    public void glLightModelxv(int pname, int[] params, int offset) {
415        checkThread();
416        mgl.glLightModelxv(pname, params, offset);
417        checkError();
418    }
419
420    public void glLightModelxv(int pname, IntBuffer params) {
421        checkThread();
422        mgl.glLightModelxv(pname, params);
423        checkError();
424    }
425
426    public void glLightf(int light, int pname, float param) {
427        checkThread();
428        mgl.glLightf(light, pname, param);
429        checkError();
430    }
431
432    public void glLightfv(int light, int pname, float[] params, int offset) {
433        checkThread();
434        mgl.glLightfv(light, pname, params, offset);
435        checkError();
436    }
437
438    public void glLightfv(int light, int pname, FloatBuffer params) {
439        checkThread();
440        mgl.glLightfv(light, pname, params);
441        checkError();
442    }
443
444    public void glLightx(int light, int pname, int param) {
445        checkThread();
446        mgl.glLightx(light, pname, param);
447        checkError();
448    }
449
450    public void glLightxv(int light, int pname, int[] params, int offset) {
451        checkThread();
452        mgl.glLightxv(light, pname, params, offset);
453        checkError();
454    }
455
456    public void glLightxv(int light, int pname, IntBuffer params) {
457        checkThread();
458        mgl.glLightxv(light, pname, params);
459        checkError();
460    }
461
462    public void glLineWidth(float width) {
463        checkThread();
464        mgl.glLineWidth(width);
465        checkError();
466    }
467
468    public void glLineWidthx(int width) {
469        checkThread();
470        mgl.glLineWidthx(width);
471        checkError();
472    }
473
474    public void glLoadIdentity() {
475        checkThread();
476        mgl.glLoadIdentity();
477        checkError();
478    }
479
480    public void glLoadMatrixf(float[] m, int offset) {
481        checkThread();
482        mgl.glLoadMatrixf(m, offset);
483        checkError();
484    }
485
486    public void glLoadMatrixf(FloatBuffer m) {
487        checkThread();
488        mgl.glLoadMatrixf(m);
489        checkError();
490    }
491
492    public void glLoadMatrixx(int[] m, int offset) {
493        checkThread();
494        mgl.glLoadMatrixx(m, offset);
495        checkError();
496    }
497
498    public void glLoadMatrixx(IntBuffer m) {
499        checkThread();
500        mgl.glLoadMatrixx(m);
501        checkError();
502    }
503
504    public void glLogicOp(int opcode) {
505        checkThread();
506        mgl.glLogicOp(opcode);
507        checkError();
508    }
509
510    public void glMaterialf(int face, int pname, float param) {
511        checkThread();
512        mgl.glMaterialf(face, pname, param);
513        checkError();
514    }
515
516    public void glMaterialfv(int face, int pname, float[] params, int offset) {
517        checkThread();
518        mgl.glMaterialfv(face, pname, params, offset);
519        checkError();
520    }
521
522    public void glMaterialfv(int face, int pname, FloatBuffer params) {
523        checkThread();
524        mgl.glMaterialfv(face, pname, params);
525        checkError();
526    }
527
528    public void glMaterialx(int face, int pname, int param) {
529        checkThread();
530        mgl.glMaterialx(face, pname, param);
531        checkError();
532    }
533
534    public void glMaterialxv(int face, int pname, int[] params, int offset) {
535        checkThread();
536        mgl.glMaterialxv(face, pname, params, offset);
537        checkError();
538    }
539
540    public void glMaterialxv(int face, int pname, IntBuffer params) {
541        checkThread();
542        mgl.glMaterialxv(face, pname, params);
543        checkError();
544    }
545
546    public void glMatrixMode(int mode) {
547        checkThread();
548        mgl.glMatrixMode(mode);
549        checkError();
550    }
551
552    public void glMultMatrixf(float[] m, int offset) {
553        checkThread();
554        mgl.glMultMatrixf(m, offset);
555        checkError();
556    }
557
558    public void glMultMatrixf(FloatBuffer m) {
559        checkThread();
560        mgl.glMultMatrixf(m);
561        checkError();
562    }
563
564    public void glMultMatrixx(int[] m, int offset) {
565        checkThread();
566        mgl.glMultMatrixx(m, offset);
567        checkError();
568    }
569
570    public void glMultMatrixx(IntBuffer m) {
571        checkThread();
572        mgl.glMultMatrixx(m);
573        checkError();
574    }
575
576    public void glMultiTexCoord4f(int target,
577            float s, float t, float r, float q) {
578        checkThread();
579        mgl.glMultiTexCoord4f(target, s, t, r, q);
580        checkError();
581    }
582
583    public void glMultiTexCoord4x(int target, int s, int t, int r, int q) {
584        checkThread();
585        mgl.glMultiTexCoord4x(target, s, t, r, q);
586        checkError();
587    }
588
589    public void glNormal3f(float nx, float ny, float nz) {
590        checkThread();
591        mgl.glNormal3f(nx, ny, nz);
592        checkError();
593    }
594
595    public void glNormal3x(int nx, int ny, int nz) {
596        checkThread();
597        mgl.glNormal3x(nx, ny, nz);
598        checkError();
599    }
600
601    public void glNormalPointer(int type, int stride, Buffer pointer) {
602        checkThread();
603        mgl.glNormalPointer(type, stride, pointer);
604        checkError();
605    }
606
607    public void glOrthof(float left, float right, float bottom, float top,
608            float near, float far) {
609        checkThread();
610        mgl.glOrthof(left, right, bottom, top, near, far);
611        checkError();
612    }
613
614    public void glOrthox(int left, int right, int bottom, int top, int near,
615            int far) {
616        checkThread();
617        mgl.glOrthox(left, right, bottom, top, near, far);
618        checkError();
619    }
620
621    public void glPixelStorei(int pname, int param) {
622        checkThread();
623        mgl.glPixelStorei(pname, param);
624        checkError();
625    }
626
627    public void glPointSize(float size) {
628        checkThread();
629        mgl.glPointSize(size);
630        checkError();
631    }
632
633    public void glPointSizex(int size) {
634        checkThread();
635        mgl.glPointSizex(size);
636        checkError();
637    }
638
639    public void glPolygonOffset(float factor, float units) {
640        checkThread();
641        mgl.glPolygonOffset(factor, units);
642        checkError();
643    }
644
645    public void glPolygonOffsetx(int factor, int units) {
646        checkThread();
647        mgl.glPolygonOffsetx(factor, units);
648        checkError();
649    }
650
651    public void glPopMatrix() {
652        checkThread();
653        mgl.glPopMatrix();
654        checkError();
655    }
656
657    public void glPushMatrix() {
658        checkThread();
659        mgl.glPushMatrix();
660        checkError();
661    }
662
663    public void glReadPixels(int x, int y, int width, int height, int format,
664            int type, Buffer pixels) {
665        checkThread();
666        mgl.glReadPixels(x, y, width, height, format, type, pixels);
667        checkError();
668    }
669
670    public void glRotatef(float angle, float x, float y, float z) {
671        checkThread();
672        mgl.glRotatef(angle, x, y, z);
673        checkError();
674    }
675
676    public void glRotatex(int angle, int x, int y, int z) {
677        checkThread();
678        mgl.glRotatex(angle, x, y, z);
679        checkError();
680    }
681
682    public void glSampleCoverage(float value, boolean invert) {
683        checkThread();
684        mgl.glSampleCoverage(value, invert);
685        checkError();
686    }
687
688    public void glSampleCoveragex(int value, boolean invert) {
689        checkThread();
690        mgl.glSampleCoveragex(value, invert);
691        checkError();
692    }
693
694    public void glScalef(float x, float y, float z) {
695        checkThread();
696        mgl.glScalef(x, y, z);
697        checkError();
698    }
699
700    public void glScalex(int x, int y, int z) {
701        checkThread();
702        mgl.glScalex(x, y, z);
703        checkError();
704    }
705
706    public void glScissor(int x, int y, int width, int height) {
707        checkThread();
708        mgl.glScissor(x, y, width, height);
709        checkError();
710    }
711
712    public void glShadeModel(int mode) {
713        checkThread();
714        mgl.glShadeModel(mode);
715        checkError();
716    }
717
718    public void glStencilFunc(int func, int ref, int mask) {
719        checkThread();
720        mgl.glStencilFunc(func, ref, mask);
721        checkError();
722    }
723
724    public void glStencilMask(int mask) {
725        checkThread();
726        mgl.glStencilMask(mask);
727        checkError();
728    }
729
730    public void glStencilOp(int fail, int zfail, int zpass) {
731        checkThread();
732        mgl.glStencilOp(fail, zfail, zpass);
733        checkError();
734    }
735
736    public void glTexCoordPointer(int size, int type,
737            int stride, Buffer pointer) {
738        checkThread();
739        mgl.glTexCoordPointer(size, type, stride, pointer);
740        checkError();
741    }
742
743    public void glTexEnvf(int target, int pname, float param) {
744        checkThread();
745        mgl.glTexEnvf(target, pname, param);
746        checkError();
747    }
748
749    public void glTexEnvfv(int target, int pname, float[] params, int offset) {
750        checkThread();
751        mgl.glTexEnvfv(target, pname, params, offset);
752        checkError();
753    }
754
755    public void glTexEnvfv(int target, int pname, FloatBuffer params) {
756        checkThread();
757        mgl.glTexEnvfv(target, pname, params);
758        checkError();
759    }
760
761    public void glTexEnvx(int target, int pname, int param) {
762        checkThread();
763        mgl.glTexEnvx(target, pname, param);
764        checkError();
765    }
766
767    public void glTexEnvxv(int target, int pname, int[] params, int offset) {
768        checkThread();
769        mgl.glTexEnvxv(target, pname, params, offset);
770        checkError();
771    }
772
773    public void glTexEnvxv(int target, int pname, IntBuffer params) {
774        checkThread();
775        mgl.glTexEnvxv(target, pname, params);
776        checkError();
777    }
778
779    public void glTexImage2D(int target, int level, int internalformat,
780            int width, int height, int border, int format, int type,
781            Buffer pixels) {
782        checkThread();
783        mgl.glTexImage2D(target, level, internalformat, width, height, border,
784                format, type, pixels);
785        checkError();
786    }
787
788    public void glTexParameterf(int target, int pname, float param) {
789        checkThread();
790        mgl.glTexParameterf(target, pname, param);
791        checkError();
792    }
793
794    public void glTexParameterx(int target, int pname, int param) {
795        checkThread();
796        mgl.glTexParameterx(target, pname, param);
797        checkError();
798    }
799
800    public void glTexParameteriv(int target, int pname, int[] params, int offset) {
801        checkThread();
802        mgl11.glTexParameteriv(target, pname, params, offset);
803        checkError();
804    }
805
806    public void glTexParameteriv(int target, int pname, IntBuffer params) {
807        checkThread();
808        mgl11.glTexParameteriv(target, pname, params);
809        checkError();
810    }
811
812    public void glTexSubImage2D(int target, int level, int xoffset,
813            int yoffset, int width, int height, int format, int type,
814            Buffer pixels) {
815        checkThread();
816        mgl.glTexSubImage2D(target, level, xoffset, yoffset, width, height,
817                format, type, pixels);
818        checkError();
819    }
820
821    public void glTranslatef(float x, float y, float z) {
822        checkThread();
823        mgl.glTranslatef(x, y, z);
824        checkError();
825    }
826
827    public void glTranslatex(int x, int y, int z) {
828        checkThread();
829        mgl.glTranslatex(x, y, z);
830        checkError();
831    }
832
833    public void glVertexPointer(int size, int type,
834            int stride, Buffer pointer) {
835        checkThread();
836        mgl.glVertexPointer(size, type, stride, pointer);
837        checkError();
838    }
839
840    public void glViewport(int x, int y, int width, int height) {
841        checkThread();
842        mgl.glViewport(x, y, width, height);
843        checkError();
844    }
845
846    public void glClipPlanef(int plane, float[] equation, int offset) {
847        checkThread();
848        mgl11.glClipPlanef(plane, equation, offset);
849        checkError();
850    }
851
852    public void glClipPlanef(int plane, FloatBuffer equation) {
853        checkThread();
854        mgl11.glClipPlanef(plane, equation);
855        checkError();
856    }
857
858    public void glClipPlanex(int plane, int[] equation, int offset) {
859        checkThread();
860        mgl11.glClipPlanex(plane, equation, offset);
861        checkError();
862    }
863
864    public void glClipPlanex(int plane, IntBuffer equation) {
865        checkThread();
866        mgl11.glClipPlanex(plane, equation);
867        checkError();
868    }
869
870    // Draw Texture Extension
871
872    public void glDrawTexfOES(float x, float y, float z,
873        float width, float height) {
874        checkThread();
875        mgl11Ext.glDrawTexfOES(x, y, z, width, height);
876        checkError();
877    }
878
879    public void glDrawTexfvOES(float[] coords, int offset) {
880        checkThread();
881        mgl11Ext.glDrawTexfvOES(coords, offset);
882        checkError();
883    }
884
885    public void glDrawTexfvOES(FloatBuffer coords) {
886        checkThread();
887        mgl11Ext.glDrawTexfvOES(coords);
888        checkError();
889    }
890
891    public void glDrawTexiOES(int x, int y, int z, int width, int height) {
892        checkThread();
893        mgl11Ext.glDrawTexiOES(x, y, z, width, height);
894        checkError();
895    }
896
897    public void glDrawTexivOES(int[] coords, int offset) {
898        checkThread();
899        mgl11Ext.glDrawTexivOES(coords, offset);
900        checkError();
901    }
902
903    public void glDrawTexivOES(IntBuffer coords) {
904        checkThread();
905        mgl11Ext.glDrawTexivOES(coords);
906        checkError();
907    }
908
909    public void glDrawTexsOES(short x, short y, short z,
910        short width, short height) {
911        checkThread();
912        mgl11Ext.glDrawTexsOES(x, y, z, width, height);
913        checkError();
914    }
915
916    public void glDrawTexsvOES(short[] coords, int offset) {
917        checkThread();
918        mgl11Ext.glDrawTexsvOES(coords, offset);
919        checkError();
920    }
921
922    public void glDrawTexsvOES(ShortBuffer coords) {
923        checkThread();
924        mgl11Ext.glDrawTexsvOES(coords);
925        checkError();
926    }
927
928    public void glDrawTexxOES(int x, int y, int z, int width, int height) {
929        checkThread();
930        mgl11Ext.glDrawTexxOES(x, y, z, width, height);
931        checkError();
932    }
933
934    public void glDrawTexxvOES(int[] coords, int offset) {
935        checkThread();
936        mgl11Ext.glDrawTexxvOES(coords, offset);
937        checkError();
938    }
939
940    public void glDrawTexxvOES(IntBuffer coords) {
941        checkThread();
942        mgl11Ext.glDrawTexxvOES(coords);
943        checkError();
944    }
945
946    public int glQueryMatrixxOES(int[] mantissa, int mantissaOffset,
947        int[] exponent, int exponentOffset) {
948        checkThread();
949        int valid = mgl10Ext.glQueryMatrixxOES(mantissa, mantissaOffset,
950            exponent, exponentOffset);
951        checkError();
952        return valid;
953    }
954
955    public int glQueryMatrixxOES(IntBuffer mantissa, IntBuffer exponent) {
956        checkThread();
957        int valid = mgl10Ext.glQueryMatrixxOES(mantissa, exponent);
958        checkError();
959        return valid;
960    }
961}
962