# GLSurfaceView.EGLWindowSurfaceFactory

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

# GLSurfaceView.EGLWindowSurfaceFactory

*** ** * ** ***

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

`
public
static


interface
GLSurfaceView.EGLWindowSurfaceFactory
`  
`


`

|------------------------------------------------------|
| android.opengl.GLSurfaceView.EGLWindowSurfaceFactory |

<br />

*** ** * ** ***

An interface for customizing the eglCreateWindowSurface and eglDestroySurface calls.

This interface must be implemented by clients wishing to call[GLSurfaceView.setEGLWindowSurfaceFactory(EGLWindowSurfaceFactory)](https://developer.android.com/reference/android/opengl/GLSurfaceView#setEGLWindowSurfaceFactory(android.opengl.GLSurfaceView.EGLWindowSurfaceFactory))

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                ||
|-------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract `[EGLSurface](https://developer.android.com/reference/javax/microedition/khronos/egl/EGLSurface) | ` `[createWindowSurface](https://developer.android.com/reference/android/opengl/GLSurfaceView.EGLWindowSurfaceFactory#createWindowSurface(javax.microedition.khronos.egl.EGL10,%20javax.microedition.khronos.egl.EGLDisplay,%20javax.microedition.khronos.egl.EGLConfig,%20java.lang.Object))`(`[EGL10](https://developer.android.com/reference/javax/microedition/khronos/egl/EGL10)` egl, `[EGLDisplay](https://developer.android.com/reference/javax/microedition/khronos/egl/EGLDisplay)` display, `[EGLConfig](https://developer.android.com/reference/javax/microedition/khronos/egl/EGLConfig)` config, `[Object](https://developer.android.com/reference/java/lang/Object)` nativeWindow) ` |
| ` abstract void`                                                                                            | ` `[destroySurface](https://developer.android.com/reference/android/opengl/GLSurfaceView.EGLWindowSurfaceFactory#destroySurface(javax.microedition.khronos.egl.EGL10,%20javax.microedition.khronos.egl.EGLDisplay,%20javax.microedition.khronos.egl.EGLSurface))`(`[EGL10](https://developer.android.com/reference/javax/microedition/khronos/egl/EGL10)` egl, `[EGLDisplay](https://developer.android.com/reference/javax/microedition/khronos/egl/EGLDisplay)` display, `[EGLSurface](https://developer.android.com/reference/javax/microedition/khronos/egl/EGLSurface)` surface) `                                                                                                              |

## Public methods

### createWindowSurface

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

```
public abstract EGLSurface createWindowSurface (EGL10 egl, 
                EGLDisplay display, 
                EGLConfig config, 
                Object nativeWindow)
```

<br />

<br />

|             Parameters              ||
|----------------|---------------------|
| `egl`          | `EGL10` <br />      |
| `display`      | `EGLDisplay` <br /> |
| `config`       | `EGLConfig` <br />  |
| `nativeWindow` | `Object` <br />     |

|                                                                      Returns                                                                       ||
|-------------------------------------------------------------------------------------------------|---------------------------------------------------|
| [EGLSurface](https://developer.android.com/reference/javax/microedition/khronos/egl/EGLSurface) | null if the surface cannot be constructed. <br /> |

### destroySurface

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

```
public abstract void destroySurface (EGL10 egl, 
                EGLDisplay display, 
                EGLSurface surface)
```

<br />

<br />

|           Parameters           ||
|-----------|---------------------|
| `egl`     | `EGL10` <br />      |
| `display` | `EGLDisplay` <br /> |
| `surface` | `EGLSurface` <br /> |