GLSurfaceView

Class of android.opengl · GLSurfaceView.java · Android's reference

public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback2

GLSurfaceView ← SurfaceView ← View

A SurfaceView that a Renderer draws into with GLES, on a thread of its own (the GL thread): it makes the EGL display, context and window surface (the runtime's EGL, snx.android.opengl.Egl10, the one the app's native GLES calls see current), calls onSurfaceCreated once for each context, onSurfaceChanged at each size, then onDrawFrame and a swap for each frame, continuously or when asked. Events queued with queueEvent run on the GL thread before the next frame. onPause stops drawing and gives up the surface, and the context too unless it is kept (setPreserveEGLContextOnPause); onResume starts again, with onSurfaceCreated for a new context.

Nested types

Fields

public static final int RENDERMODE_WHEN_DIRTY = 0 source
public static final int RENDERMODE_CONTINUOUSLY = 1 source
public static final int DEBUG_CHECK_GL_ERROR = 1 source
public static final int DEBUG_LOG_GL_CALLS = 2 source

Constructors

public GLSurfaceView(Context context) source
public GLSurfaceView(Context context, AttributeSet attrs) source

Methods

public void setGLWrapper(GLWrapper glWrapper) source
public void setDebugFlags(int debugFlags) source
public int getDebugFlags() source
public void setPreserveEGLContextOnPause(boolean preserveOnPause) source
public boolean getPreserveEGLContextOnPause() source
public void setRenderer(Renderer renderer) source
public void setEGLContextFactory(EGLContextFactory factory) source
public void setEGLWindowSurfaceFactory(EGLWindowSurfaceFactory factory) source
public void setEGLConfigChooser(EGLConfigChooser configChooser) source
public void setEGLConfigChooser(boolean needDepth) source
public void setEGLConfigChooser(int redSize, int greenSize, int blueSize, int alphaSize, int depthSize, int stencilSize) source
public void setEGLContextClientVersion(int version) source
public void setRenderMode(int renderMode) source
public int getRenderMode() source
public void requestRender() source
public void queueEvent(Runnable r) source
public void onPause() source
public void onResume() source
public void surfaceCreated(SurfaceHolder holder) source
public void surfaceDestroyed(SurfaceHolder holder) source
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) source
public void surfaceRedrawNeeded(SurfaceHolder holder) source
protected void onDetachedFromWindow() source

Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.