public class EglCore implements GLReleasable
Core EGL state (display, context, config).
The EGLContext must only be attached to one thread at a time. This class is not thread-safe.
Inspired by Grafika
Modifier and Type | Class and Description |
---|---|
static class |
EglCore.Companion |
Modifier and Type | Field and Description |
---|---|
static EglCore.Companion |
Companion |
static int |
FLAG_EGL_RECORDABLE_ANDROID |
Constructor and Description |
---|
EglCore(android.opengl.EGLContext sharedContext,
int flags)
Core EGL state (display, context, config).
|
EglCore(android.opengl.EGLContext sharedContext)
Core EGL state (display, context, config).
|
EglCore()
Core EGL state (display, context, config).
|
Modifier and Type | Method and Description |
---|---|
android.opengl.EGLSurface |
createOffscreenSurface(int width,
int height)
Creates an EGL surface associated with an offscreen buffer.
|
android.opengl.EGLSurface |
createWindowSurface(android.view.Surface surface)
Creates an EGL surface associated with a Surface.
|
android.opengl.EGLContext |
getEglContext() |
boolean |
makeCurrent(android.opengl.EGLSurface eglSurface)
Makes our EGL context current, using the supplied surface for both "draw" and "read".
|
void |
release()
Discards all resources held by this class, notably the EGL context. This must be
called from the thread where the context was created.
|
void |
releaseSurface(android.opengl.EGLSurface eglSurface)
Destroys the specified surface. Note the EGLSurface won't actually be destroyed if it's
still current in a context.
|
void |
setPresentationTime(android.opengl.EGLSurface eglSurface,
long nanoseconds)
Sends the presentation time stamp to EGL. Time is expressed in nanoseconds.
|
boolean |
swapBuffers(android.opengl.EGLSurface eglSurface)
Calls eglSwapBuffers. Use this to "publish" the current frame.
|
release
public static int FLAG_EGL_RECORDABLE_ANDROID
public static EglCore.Companion Companion
public EglCore(android.opengl.EGLContext sharedContext, int flags)
Core EGL state (display, context, config).
The EGLContext must only be attached to one thread at a time. This class is not thread-safe.
Inspired by Grafika
public EglCore(android.opengl.EGLContext sharedContext)
Core EGL state (display, context, config).
The EGLContext must only be attached to one thread at a time. This class is not thread-safe.
Inspired by Grafika
public android.opengl.EGLContext getEglContext()
public void release()
Discards all resources held by this class, notably the EGL context. This must be called from the thread where the context was created.
On completion, no context will be current.
public void releaseSurface(android.opengl.EGLSurface eglSurface)
Destroys the specified surface. Note the EGLSurface won't actually be destroyed if it's still current in a context.
public android.opengl.EGLSurface createWindowSurface(android.view.Surface surface)
Creates an EGL surface associated with a Surface.
If this is destined for MediaCodec, the EGLConfig should have the "recordable" attribute.
public android.opengl.EGLSurface createOffscreenSurface(int width, int height)
Creates an EGL surface associated with an offscreen buffer.
public boolean makeCurrent(android.opengl.EGLSurface eglSurface)
Makes our EGL context current, using the supplied surface for both "draw" and "read".
public boolean swapBuffers(android.opengl.EGLSurface eglSurface)
Calls eglSwapBuffers. Use this to "publish" the current frame.
public void setPresentationTime(android.opengl.EGLSurface eglSurface, long nanoseconds)
Sends the presentation time stamp to EGL. Time is expressed in nanoseconds.