FileDocCategorySizeDatePackage
GLErrorWrapper.javaAPI DocAndroid 1.5 API25930Wed May 06 22:42:00 BST 2009android.opengl

GLErrorWrapper

public class GLErrorWrapper extends GLWrapperBase
Implement an error checking wrapper. The wrapper will automatically call glError after each GL operation, and throw a GLException if an error occurs. (By design, calling glError itself will not cause an exception to be thrown.) Enabling error checking is an alternative to manually calling glError after every GL operation.

Fields Summary
boolean
mCheckError
boolean
mCheckThread
Thread
mOurThread
Constructors Summary
public GLErrorWrapper(javax.microedition.khronos.opengles.GL gl, int configFlags)

        super(gl);
        mCheckError = (configFlags & GLDebugHelper.CONFIG_CHECK_GL_ERROR) != 0;
        mCheckThread = (configFlags & GLDebugHelper.CONFIG_CHECK_THREAD) != 0;
    
Methods Summary
private voidcheckError()

        if (mCheckError) {
            int glError;
            if ((glError = mgl.glGetError()) != 0) {
                throw new GLException(glError);
            }
        }
    
private voidcheckThread()

        if (mCheckThread) {
            Thread currentThread = Thread.currentThread();
            if (mOurThread == null) {
                mOurThread = currentThread;
            } else {
                if (!mOurThread.equals(currentThread)) {
                    throw new GLException(GLDebugHelper.ERROR_WRONG_THREAD,
                            "OpenGL method called from wrong thread.");
                }
            }
        }
    
public voidglActiveTexture(int texture)

        checkThread();
        mgl.glActiveTexture(texture);
        checkError();
    
public voidglAlphaFunc(int func, float ref)

        checkThread();
        mgl.glAlphaFunc(func, ref);
        checkError();
    
public voidglAlphaFuncx(int func, int ref)

        checkThread();
        mgl.glAlphaFuncx(func, ref);
        checkError();
    
public voidglBindTexture(int target, int texture)

        checkThread();
        mgl.glBindTexture(target, texture);
        checkError();
    
public voidglBlendFunc(int sfactor, int dfactor)

        checkThread();
        mgl.glBlendFunc(sfactor, dfactor);
        checkError();
    
public voidglClear(int mask)

        checkThread();
        mgl.glClear(mask);
        checkError();
    
public voidglClearColor(float red, float green, float blue, float alpha)

        checkThread();
        mgl.glClearColor(red, green, blue, alpha);
        checkError();
    
public voidglClearColorx(int red, int green, int blue, int alpha)

        checkThread();
        mgl.glClearColorx(red, green, blue, alpha);
        checkError();
    
public voidglClearDepthf(float depth)

        checkThread();
        mgl.glClearDepthf(depth);
        checkError();
    
public voidglClearDepthx(int depth)

        checkThread();
        mgl.glClearDepthx(depth);
        checkError();
    
public voidglClearStencil(int s)

        checkThread();
        mgl.glClearStencil(s);
        checkError();
    
public voidglClientActiveTexture(int texture)

        checkThread();
        mgl.glClientActiveTexture(texture);
        checkError();
    
public voidglClipPlanef(int plane, float[] equation, int offset)

        checkThread();
        mgl11.glClipPlanef(plane, equation, offset);
        checkError();
    
public voidglClipPlanef(int plane, java.nio.FloatBuffer equation)

        checkThread();
        mgl11.glClipPlanef(plane, equation);
        checkError();
    
public voidglClipPlanex(int plane, int[] equation, int offset)

        checkThread();
        mgl11.glClipPlanex(plane, equation, offset);
        checkError();
    
public voidglClipPlanex(int plane, java.nio.IntBuffer equation)

        checkThread();
        mgl11.glClipPlanex(plane, equation);
        checkError();
    
public voidglColor4f(float red, float green, float blue, float alpha)

        checkThread();
        mgl.glColor4f(red, green, blue, alpha);
        checkError();
    
public voidglColor4x(int red, int green, int blue, int alpha)

        checkThread();
        mgl.glColor4x(red, green, blue, alpha);
        checkError();
    
public voidglColorMask(boolean red, boolean green, boolean blue, boolean alpha)

        checkThread();
        mgl.glColorMask(red, green, blue, alpha);
        checkError();
    
public voidglColorPointer(int size, int type, int stride, java.nio.Buffer pointer)

        checkThread();
        mgl.glColorPointer(size, type, stride, pointer);
        checkError();
    
public voidglCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, java.nio.Buffer data)

        checkThread();
        mgl.glCompressedTexImage2D(target, level, internalformat, width,
                height, border, imageSize, data);
        checkError();
    
public voidglCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, java.nio.Buffer data)

        checkThread();
        mgl.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width,
                height, format, imageSize, data);
        checkError();
    
public voidglCopyTexImage2D(int target, int level, int internalformat, int x, int y, int width, int height, int border)

        checkThread();
        mgl.glCopyTexImage2D(target, level, internalformat, x, y, width,
                height, border);
        checkError();
    
public voidglCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height)

        checkThread();
        mgl.glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width,
                height);
        checkError();
    
public voidglCullFace(int mode)

        checkThread();
        mgl.glCullFace(mode);
        checkError();
    
public voidglDeleteTextures(int n, int[] textures, int offset)

        checkThread();
        mgl.glDeleteTextures(n, textures, offset);
        checkError();
    
public voidglDeleteTextures(int n, java.nio.IntBuffer textures)

        checkThread();
        mgl.glDeleteTextures(n, textures);
        checkError();
    
public voidglDepthFunc(int func)

        checkThread();
        mgl.glDepthFunc(func);
        checkError();
    
public voidglDepthMask(boolean flag)

        checkThread();
        mgl.glDepthMask(flag);
        checkError();
    
public voidglDepthRangef(float near, float far)

        checkThread();
        mgl.glDepthRangef(near, far);
        checkError();
    
public voidglDepthRangex(int near, int far)

        checkThread();
        mgl.glDepthRangex(near, far);
        checkError();
    
public voidglDisable(int cap)

        checkThread();
        mgl.glDisable(cap);
        checkError();
    
public voidglDisableClientState(int array)

        checkThread();
        mgl.glDisableClientState(array);
        checkError();
    
public voidglDrawArrays(int mode, int first, int count)

        checkThread();
        mgl.glDrawArrays(mode, first, count);
        checkError();
    
public voidglDrawElements(int mode, int count, int type, java.nio.Buffer indices)

        checkThread();
        mgl.glDrawElements(mode, count, type, indices);
        checkError();
    
public voidglDrawTexfOES(float x, float y, float z, float width, float height)

        checkThread();
        mgl11Ext.glDrawTexfOES(x, y, z, width, height);
        checkError();
    
public voidglDrawTexfvOES(float[] coords, int offset)

        checkThread();
        mgl11Ext.glDrawTexfvOES(coords, offset);
        checkError();
    
public voidglDrawTexfvOES(java.nio.FloatBuffer coords)

        checkThread();
        mgl11Ext.glDrawTexfvOES(coords);
        checkError();
    
public voidglDrawTexiOES(int x, int y, int z, int width, int height)

        checkThread();
        mgl11Ext.glDrawTexiOES(x, y, z, width, height);
        checkError();
    
public voidglDrawTexivOES(int[] coords, int offset)

        checkThread();
        mgl11Ext.glDrawTexivOES(coords, offset);
        checkError();
    
public voidglDrawTexivOES(java.nio.IntBuffer coords)

        checkThread();
        mgl11Ext.glDrawTexivOES(coords);
        checkError();
    
public voidglDrawTexsOES(short x, short y, short z, short width, short height)

        checkThread();
        mgl11Ext.glDrawTexsOES(x, y, z, width, height);
        checkError();
    
public voidglDrawTexsvOES(short[] coords, int offset)

        checkThread();
        mgl11Ext.glDrawTexsvOES(coords, offset);
        checkError();
    
public voidglDrawTexsvOES(java.nio.ShortBuffer coords)

        checkThread();
        mgl11Ext.glDrawTexsvOES(coords);
        checkError();
    
public voidglDrawTexxOES(int x, int y, int z, int width, int height)

        checkThread();
        mgl11Ext.glDrawTexxOES(x, y, z, width, height);
        checkError();
    
public voidglDrawTexxvOES(int[] coords, int offset)

        checkThread();
        mgl11Ext.glDrawTexxvOES(coords, offset);
        checkError();
    
public voidglDrawTexxvOES(java.nio.IntBuffer coords)

        checkThread();
        mgl11Ext.glDrawTexxvOES(coords);
        checkError();
    
public voidglEnable(int cap)

        checkThread();
        mgl.glEnable(cap);
        checkError();
    
public voidglEnableClientState(int array)

        checkThread();
        mgl.glEnableClientState(array);
        checkError();
    
public voidglFinish()

        checkThread();
        mgl.glFinish();
        checkError();
    
public voidglFlush()

        checkThread();
        mgl.glFlush();
        checkError();
    
public voidglFogf(int pname, float param)

        checkThread();
        mgl.glFogf(pname, param);
        checkError();
    
public voidglFogfv(int pname, float[] params, int offset)

        checkThread();
        mgl.glFogfv(pname, params, offset);
        checkError();
    
public voidglFogfv(int pname, java.nio.FloatBuffer params)

        checkThread();
        mgl.glFogfv(pname, params);
        checkError();
    
public voidglFogx(int pname, int param)

        checkThread();
        mgl.glFogx(pname, param);
        checkError();
    
public voidglFogxv(int pname, int[] params, int offset)

        checkThread();
        mgl.glFogxv(pname, params, offset);
        checkError();
    
public voidglFogxv(int pname, java.nio.IntBuffer params)

        checkThread();
        mgl.glFogxv(pname, params);
        checkError();
    
public voidglFrontFace(int mode)

        checkThread();
        mgl.glFrontFace(mode);
        checkError();
    
public voidglFrustumf(float left, float right, float bottom, float top, float near, float far)

        checkThread();
        mgl.glFrustumf(left, right, bottom, top, near, far);
        checkError();
    
public voidglFrustumx(int left, int right, int bottom, int top, int near, int far)

        checkThread();
        mgl.glFrustumx(left, right, bottom, top, near, far);
        checkError();
    
public voidglGenTextures(int n, int[] textures, int offset)

        checkThread();
        mgl.glGenTextures(n, textures, offset);
        checkError();
    
public voidglGenTextures(int n, java.nio.IntBuffer textures)

        checkThread();
        mgl.glGenTextures(n, textures);
        checkError();
    
public intglGetError()

        checkThread();
        int result = mgl.glGetError();
        return result;
    
public voidglGetIntegerv(int pname, int[] params, int offset)

        checkThread();
        mgl.glGetIntegerv(pname, params, offset);
        checkError();
    
public voidglGetIntegerv(int pname, java.nio.IntBuffer params)

        checkThread();
        mgl.glGetIntegerv(pname, params);
        checkError();
    
public java.lang.StringglGetString(int name)

        checkThread();
        String result = mgl.glGetString(name);
        checkError();
        return result;
    
public voidglHint(int target, int mode)

        checkThread();
        mgl.glHint(target, mode);
        checkError();
    
public voidglLightModelf(int pname, float param)

        checkThread();
        mgl.glLightModelf(pname, param);
        checkError();
    
public voidglLightModelfv(int pname, float[] params, int offset)

        checkThread();
        mgl.glLightModelfv(pname, params, offset);
        checkError();
    
public voidglLightModelfv(int pname, java.nio.FloatBuffer params)

        checkThread();
        mgl.glLightModelfv(pname, params);
        checkError();
    
public voidglLightModelx(int pname, int param)

        checkThread();
        mgl.glLightModelx(pname, param);
        checkError();
    
public voidglLightModelxv(int pname, int[] params, int offset)

        checkThread();
        mgl.glLightModelxv(pname, params, offset);
        checkError();
    
public voidglLightModelxv(int pname, java.nio.IntBuffer params)

        checkThread();
        mgl.glLightModelxv(pname, params);
        checkError();
    
public voidglLightf(int light, int pname, float param)

        checkThread();
        mgl.glLightf(light, pname, param);
        checkError();
    
public voidglLightfv(int light, int pname, float[] params, int offset)

        checkThread();
        mgl.glLightfv(light, pname, params, offset);
        checkError();
    
public voidglLightfv(int light, int pname, java.nio.FloatBuffer params)

        checkThread();
        mgl.glLightfv(light, pname, params);
        checkError();
    
public voidglLightx(int light, int pname, int param)

        checkThread();
        mgl.glLightx(light, pname, param);
        checkError();
    
public voidglLightxv(int light, int pname, int[] params, int offset)

        checkThread();
        mgl.glLightxv(light, pname, params, offset);
        checkError();
    
public voidglLightxv(int light, int pname, java.nio.IntBuffer params)

        checkThread();
        mgl.glLightxv(light, pname, params);
        checkError();
    
public voidglLineWidth(float width)

        checkThread();
        mgl.glLineWidth(width);
        checkError();
    
public voidglLineWidthx(int width)

        checkThread();
        mgl.glLineWidthx(width);
        checkError();
    
public voidglLoadIdentity()

        checkThread();
        mgl.glLoadIdentity();
        checkError();
    
public voidglLoadMatrixf(float[] m, int offset)

        checkThread();
        mgl.glLoadMatrixf(m, offset);
        checkError();
    
public voidglLoadMatrixf(java.nio.FloatBuffer m)

        checkThread();
        mgl.glLoadMatrixf(m);
        checkError();
    
public voidglLoadMatrixx(int[] m, int offset)

        checkThread();
        mgl.glLoadMatrixx(m, offset);
        checkError();
    
public voidglLoadMatrixx(java.nio.IntBuffer m)

        checkThread();
        mgl.glLoadMatrixx(m);
        checkError();
    
public voidglLogicOp(int opcode)

        checkThread();
        mgl.glLogicOp(opcode);
        checkError();
    
public voidglMaterialf(int face, int pname, float param)

        checkThread();
        mgl.glMaterialf(face, pname, param);
        checkError();
    
public voidglMaterialfv(int face, int pname, float[] params, int offset)

        checkThread();
        mgl.glMaterialfv(face, pname, params, offset);
        checkError();
    
public voidglMaterialfv(int face, int pname, java.nio.FloatBuffer params)

        checkThread();
        mgl.glMaterialfv(face, pname, params);
        checkError();
    
public voidglMaterialx(int face, int pname, int param)

        checkThread();
        mgl.glMaterialx(face, pname, param);
        checkError();
    
public voidglMaterialxv(int face, int pname, int[] params, int offset)

        checkThread();
        mgl.glMaterialxv(face, pname, params, offset);
        checkError();
    
public voidglMaterialxv(int face, int pname, java.nio.IntBuffer params)

        checkThread();
        mgl.glMaterialxv(face, pname, params);
        checkError();
    
public voidglMatrixMode(int mode)

        checkThread();
        mgl.glMatrixMode(mode);
        checkError();
    
public voidglMultMatrixf(float[] m, int offset)

        checkThread();
        mgl.glMultMatrixf(m, offset);
        checkError();
    
public voidglMultMatrixf(java.nio.FloatBuffer m)

        checkThread();
        mgl.glMultMatrixf(m);
        checkError();
    
public voidglMultMatrixx(int[] m, int offset)

        checkThread();
        mgl.glMultMatrixx(m, offset);
        checkError();
    
public voidglMultMatrixx(java.nio.IntBuffer m)

        checkThread();
        mgl.glMultMatrixx(m);
        checkError();
    
public voidglMultiTexCoord4f(int target, float s, float t, float r, float q)

        checkThread();
        mgl.glMultiTexCoord4f(target, s, t, r, q);
        checkError();
    
public voidglMultiTexCoord4x(int target, int s, int t, int r, int q)

        checkThread();
        mgl.glMultiTexCoord4x(target, s, t, r, q);
        checkError();
    
public voidglNormal3f(float nx, float ny, float nz)

        checkThread();
        mgl.glNormal3f(nx, ny, nz);
        checkError();
    
public voidglNormal3x(int nx, int ny, int nz)

        checkThread();
        mgl.glNormal3x(nx, ny, nz);
        checkError();
    
public voidglNormalPointer(int type, int stride, java.nio.Buffer pointer)

        checkThread();
        mgl.glNormalPointer(type, stride, pointer);
        checkError();
    
public voidglOrthof(float left, float right, float bottom, float top, float near, float far)

        checkThread();
        mgl.glOrthof(left, right, bottom, top, near, far);
        checkError();
    
public voidglOrthox(int left, int right, int bottom, int top, int near, int far)

        checkThread();
        mgl.glOrthox(left, right, bottom, top, near, far);
        checkError();
    
public voidglPixelStorei(int pname, int param)

        checkThread();
        mgl.glPixelStorei(pname, param);
        checkError();
    
public voidglPointSize(float size)

        checkThread();
        mgl.glPointSize(size);
        checkError();
    
public voidglPointSizex(int size)

        checkThread();
        mgl.glPointSizex(size);
        checkError();
    
public voidglPolygonOffset(float factor, float units)

        checkThread();
        mgl.glPolygonOffset(factor, units);
        checkError();
    
public voidglPolygonOffsetx(int factor, int units)

        checkThread();
        mgl.glPolygonOffsetx(factor, units);
        checkError();
    
public voidglPopMatrix()

        checkThread();
        mgl.glPopMatrix();
        checkError();
    
public voidglPushMatrix()

        checkThread();
        mgl.glPushMatrix();
        checkError();
    
public intglQueryMatrixxOES(int[] mantissa, int mantissaOffset, int[] exponent, int exponentOffset)

        checkThread();
        int valid = mgl10Ext.glQueryMatrixxOES(mantissa, mantissaOffset,
            exponent, exponentOffset);
        checkError();
        return valid;
    
public intglQueryMatrixxOES(java.nio.IntBuffer mantissa, java.nio.IntBuffer exponent)

        checkThread();
        int valid = mgl10Ext.glQueryMatrixxOES(mantissa, exponent);
        checkError();
        return valid;
    
public voidglReadPixels(int x, int y, int width, int height, int format, int type, java.nio.Buffer pixels)

        checkThread();
        mgl.glReadPixels(x, y, width, height, format, type, pixels);
        checkError();
    
public voidglRotatef(float angle, float x, float y, float z)

        checkThread();
        mgl.glRotatef(angle, x, y, z);
        checkError();
    
public voidglRotatex(int angle, int x, int y, int z)

        checkThread();
        mgl.glRotatex(angle, x, y, z);
        checkError();
    
public voidglSampleCoverage(float value, boolean invert)

        checkThread();
        mgl.glSampleCoverage(value, invert);
        checkError();
    
public voidglSampleCoveragex(int value, boolean invert)

        checkThread();
        mgl.glSampleCoveragex(value, invert);
        checkError();
    
public voidglScalef(float x, float y, float z)

        checkThread();
        mgl.glScalef(x, y, z);
        checkError();
    
public voidglScalex(int x, int y, int z)

        checkThread();
        mgl.glScalex(x, y, z);
        checkError();
    
public voidglScissor(int x, int y, int width, int height)

        checkThread();
        mgl.glScissor(x, y, width, height);
        checkError();
    
public voidglShadeModel(int mode)

        checkThread();
        mgl.glShadeModel(mode);
        checkError();
    
public voidglStencilFunc(int func, int ref, int mask)

        checkThread();
        mgl.glStencilFunc(func, ref, mask);
        checkError();
    
public voidglStencilMask(int mask)

        checkThread();
        mgl.glStencilMask(mask);
        checkError();
    
public voidglStencilOp(int fail, int zfail, int zpass)

        checkThread();
        mgl.glStencilOp(fail, zfail, zpass);
        checkError();
    
public voidglTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer)

        checkThread();
        mgl.glTexCoordPointer(size, type, stride, pointer);
        checkError();
    
public voidglTexEnvf(int target, int pname, float param)

        checkThread();
        mgl.glTexEnvf(target, pname, param);
        checkError();
    
public voidglTexEnvfv(int target, int pname, float[] params, int offset)

        checkThread();
        mgl.glTexEnvfv(target, pname, params, offset);
        checkError();
    
public voidglTexEnvfv(int target, int pname, java.nio.FloatBuffer params)

        checkThread();
        mgl.glTexEnvfv(target, pname, params);
        checkError();
    
public voidglTexEnvx(int target, int pname, int param)

        checkThread();
        mgl.glTexEnvx(target, pname, param);
        checkError();
    
public voidglTexEnvxv(int target, int pname, int[] params, int offset)

        checkThread();
        mgl.glTexEnvxv(target, pname, params, offset);
        checkError();
    
public voidglTexEnvxv(int target, int pname, java.nio.IntBuffer params)

        checkThread();
        mgl.glTexEnvxv(target, pname, params);
        checkError();
    
public voidglTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, java.nio.Buffer pixels)

        checkThread();
        mgl.glTexImage2D(target, level, internalformat, width, height, border,
                format, type, pixels);
        checkError();
    
public voidglTexParameterf(int target, int pname, float param)

        checkThread();
        mgl.glTexParameterf(target, pname, param);
        checkError();
    
public voidglTexParameteriv(int target, int pname, int[] params, int offset)

        checkThread();
        mgl11.glTexParameteriv(target, pname, params, offset);
        checkError();
    
public voidglTexParameteriv(int target, int pname, java.nio.IntBuffer params)

        checkThread();
        mgl11.glTexParameteriv(target, pname, params);
        checkError();
    
public voidglTexParameterx(int target, int pname, int param)

        checkThread();
        mgl.glTexParameterx(target, pname, param);
        checkError();
    
public voidglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, java.nio.Buffer pixels)

        checkThread();
        mgl.glTexSubImage2D(target, level, xoffset, yoffset, width, height,
                format, type, pixels);
        checkError();
    
public voidglTranslatef(float x, float y, float z)

        checkThread();
        mgl.glTranslatef(x, y, z);
        checkError();
    
public voidglTranslatex(int x, int y, int z)

        checkThread();
        mgl.glTranslatex(x, y, z);
        checkError();
    
public voidglVertexPointer(int size, int type, int stride, java.nio.Buffer pointer)

        checkThread();
        mgl.glVertexPointer(size, type, stride, pointer);
        checkError();
    
public voidglViewport(int x, int y, int width, int height)

        checkThread();
        mgl.glViewport(x, y, width, height);
        checkError();