# GLDebugHelper

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/opengl/GLDebugHelper#constants)\|[Ctors](https://developer.android.com/reference/android/opengl/GLDebugHelper#pubctors)\|[Methods](https://developer.android.com/reference/android/opengl/GLDebugHelper#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/opengl/GLDebugHelper#inhmethods)  

# GLDebugHelper

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/opengl/GLDebugHelper "View this page in Kotlin")\|Java

`
public


class
GLDebugHelper
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.opengl.GLDebugHelper |

<br />

*** ** * ** ***

A helper class for debugging OpenGL ES applications. Wraps the supplied GL interface with a new GL interface that adds support for error checking and logging.

## Summary

|                                                                                                                          ### Constants                                                                                                                           ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [CONFIG_CHECK_GL_ERROR](https://developer.android.com/reference/android/opengl/GLDebugHelper#CONFIG_CHECK_GL_ERROR) Check glError() after every call.                                                                                                     |
| `int` | [CONFIG_CHECK_THREAD](https://developer.android.com/reference/android/opengl/GLDebugHelper#CONFIG_CHECK_THREAD) Check if all calls are on the same thread.                                                                                                |
| `int` | [CONFIG_LOG_ARGUMENT_NAMES](https://developer.android.com/reference/android/opengl/GLDebugHelper#CONFIG_LOG_ARGUMENT_NAMES) Print argument names when logging GL Calls.                                                                                   |
| `int` | [ERROR_WRONG_THREAD](https://developer.android.com/reference/android/opengl/GLDebugHelper#ERROR_WRONG_THREAD) The Error number used in the GLException that is thrown if CONFIG_CHECK_THREAD is enabled and you call OpenGL ES on the a different thread. |

|                                             ### Public constructors                                              ||
|---------------------------------------------------------------------------------------------------------------|---|
| ` `[GLDebugHelper](https://developer.android.com/reference/android/opengl/GLDebugHelper#GLDebugHelper())`() ` |

|                                                                                                                                                                                                                                                                ### Public methods                                                                                                                                                                                                                                                                 ||
|------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[EGL](https://developer.android.com/reference/javax/microedition/khronos/egl/EGL)    | ` `[wrap](https://developer.android.com/reference/android/opengl/GLDebugHelper#wrap(javax.microedition.khronos.egl.EGL,%20int,%20java.io.Writer))`(`[EGL](https://developer.android.com/reference/javax/microedition/khronos/egl/EGL)` egl, int configFlags, `[Writer](https://developer.android.com/reference/java/io/Writer)` log) ` Wrap an existing EGL interface in a new EGL interface that adds support for error checking and/or logging. |
| ` static `[GL](https://developer.android.com/reference/javax/microedition/khronos/opengles/GL) | ` `[wrap](https://developer.android.com/reference/android/opengl/GLDebugHelper#wrap(javax.microedition.khronos.opengles.GL,%20int,%20java.io.Writer))`(`[GL](https://developer.android.com/reference/javax/microedition/khronos/opengles/GL)` gl, int configFlags, `[Writer](https://developer.android.com/reference/java/io/Writer)` log) `                                                                                                      |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### CONFIG_CHECK_GL_ERROR

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int CONFIG_CHECK_GL_ERROR
```

Check glError() after every call.

<br />

Constant Value: 1 (0x00000001)  

### CONFIG_CHECK_THREAD

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int CONFIG_CHECK_THREAD
```

Check if all calls are on the same thread.

<br />

Constant Value: 2 (0x00000002)  

### CONFIG_LOG_ARGUMENT_NAMES

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int CONFIG_LOG_ARGUMENT_NAMES
```

Print argument names when logging GL Calls.

<br />

Constant Value: 4 (0x00000004)  

### ERROR_WRONG_THREAD

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int ERROR_WRONG_THREAD
```

The Error number used in the GLException that is thrown if CONFIG_CHECK_THREAD is enabled and you call OpenGL ES on the a different thread.

<br />

Constant Value: 28672 (0x00007000)

## Public constructors

### GLDebugHelper

```
public GLDebugHelper ()
```

<br />

<br />

## Public methods

### wrap

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static EGL wrap (EGL egl, 
                int configFlags, 
                Writer log)
```

Wrap an existing EGL interface in a new EGL interface that adds support for error checking and/or logging.

<br />

|                                                          Parameters                                                           ||
|---------------|----------------------------------------------------------------------------------------------------------------|
| `egl`         | `EGL`: the existing GL interface. Must implement EGL and EGL10. May optionally implement EGL11 as well. <br /> |
| `configFlags` | `int`: A bitmask of error checking flags. <br />                                                               |
| `log`         | `Writer`: - null to disable logging, non-null to enable logging. <br />                                        |

|                                                       Returns                                                        ||
|-----------------------------------------------------------------------------------|-----------------------------------|
| [EGL](https://developer.android.com/reference/javax/microedition/khronos/egl/EGL) | the wrapped EGL interface. <br /> |

### wrap

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static GL wrap (GL gl, 
                int configFlags, 
                Writer log)
```

<br />

<br />

|           Parameters           ||
|---------------|-----------------|
| `gl`          | `GL` <br />     |
| `configFlags` | `int` <br />    |
| `log`         | `Writer` <br /> |

|                                           Returns                                            ||
|--------------------------------------------------------------------------------------|--------|
| [GL](https://developer.android.com/reference/javax/microedition/khronos/opengles/GL) | <br /> |