public final class EglCore
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_RECORDABLE
Constructor flag: surface must be recordable.
|
static int |
FLAG_TRY_GLES3
Constructor flag: ask for GLES3, fall back to GLES2 if not available.
|
Constructor and Description |
---|
EglCore()
Prepares EGL display and context.
|
EglCore(EGLContext sharedContext,
int flags)
Prepares EGL display and context.
|
Modifier and Type | Method and Description |
---|---|
EGLSurface |
createOffscreenSurface(int width,
int height)
Creates an EGL surface associated with an offscreen buffer.
|
EGLSurface |
createWindowSurface(java.lang.Object surface)
Creates an EGL surface associated with a Surface.
|
int |
getGlVersion()
Returns the GLES version this context is configured for (currently 2 or 3).
|
boolean |
isCurrent(EGLSurface eglSurface)
Returns true if our context and the specified surface are current.
|
static void |
logCurrent(java.lang.String msg)
Writes the current display, context, and surface to the log.
|
void |
makeCurrent(EGLSurface eglSurface)
Makes our EGL context current, using the supplied surface for both drawing and reading.
|
void |
makeCurrent(EGLSurface drawSurface,
EGLSurface readSurface)
Makes our EGL context current, using the supplied "draw" and "read" surfaces.
|
void |
makeNothingCurrent()
Makes no context current.
|
java.lang.String |
queryString(int what)
Queries a string value.
|
int |
querySurface(EGLSurface eglSurface,
int what)
Performs a simple surface query.
|
void |
release()
Discards all resources held by this class, notably the EGL context.
|
void |
releaseSurface(EGLSurface eglSurface)
Destroys the specified surface.
|
void |
setPresentationTime(EGLSurface eglSurface,
long nsecs)
Sends the presentation time stamp to EGL.
|
boolean |
swapBuffers(EGLSurface eglSurface)
Calls eglSwapBuffers.
|
public static final int FLAG_RECORDABLE
public static final int FLAG_TRY_GLES3
public EglCore()
public EglCore(EGLContext sharedContext, int flags)
sharedContext
- The context to share, or null if sharing is not desired.flags
- Configuration bit flags, for example, FLAG_RECORDABLE.public void release()
public void releaseSurface(EGLSurface eglSurface)
public EGLSurface createWindowSurface(java.lang.Object surface)
public EGLSurface createOffscreenSurface(int width, int height)
public void makeCurrent(EGLSurface eglSurface)
public void makeCurrent(EGLSurface drawSurface, EGLSurface readSurface)
public void makeNothingCurrent()
public boolean swapBuffers(EGLSurface eglSurface)
public void setPresentationTime(EGLSurface eglSurface, long nsecs)
public boolean isCurrent(EGLSurface eglSurface)
public int querySurface(EGLSurface eglSurface, int what)
public java.lang.String queryString(int what)
public int getGlVersion()
public static void logCurrent(java.lang.String msg)
© 2016 - 2018 Wowza Media Systems, LLC. All rights reserved. Terms | Privacy | Trademarks | Legal