本文整理汇总了Java中javax.microedition.khronos.egl.EGL10.EGL_NO_CONTEXT属性的典型用法代码示例。如果您正苦于以下问题:Java EGL10.EGL_NO_CONTEXT属性的具体用法?Java EGL10.EGL_NO_CONTEXT怎么用?Java EGL10.EGL_NO_CONTEXT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.microedition.khronos.egl.EGL10
的用法示例。
在下文中一共展示了EGL10.EGL_NO_CONTEXT属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContext
@Override
public EGLContext createContext(
EGL10 egl,
EGLDisplay display,
EGLConfig eglConfig)
{
Log.w(ConstantsUI.TAG, "creating OpenGL ES 2.0 context");
checkEglError(egl, "Before eglCreateContext");
int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE};
mEglContext =
egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
if (EGL10.EGL_NO_CONTEXT == mEglContext) {
throwEglException(egl, "eglCreateContext");
}
return mEglContext;
}
示例2: release
public void release() {
mEGL.eglDestroySurface(mEGLDisplay, mEGLSurface);
if (mEGLDisplay != EGL10.EGL_NO_DISPLAY) {
mEGL.eglMakeCurrent(mEGLDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE,
EGL10.EGL_NO_CONTEXT);
mEGL.eglDestroyContext(mEGLDisplay, mEGLContext);
//EGL14.eglReleaseThread();
mEGL.eglTerminate(mEGLDisplay);
}
mEGLDisplay = EGL10.EGL_NO_DISPLAY;
mEGLConfig = null;
mEGLContext = EGL10.EGL_NO_CONTEXT;
mEGLSurface = EGL10.EGL_NO_SURFACE;
mWidth = mHeight = -1;
}
示例3: start
public void start() {
mEgl = (EGL10) EGLContext.getEGL();
mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
if (mEglDisplay == EGL10.EGL_NO_DISPLAY) {
throw new RuntimeException("eglGetDisplay failed");
}
int[] version = new int[2];
if (!mEgl.eglInitialize(mEglDisplay, version)) {
throw new RuntimeException("eglInitialize failed");
}
mEglConfig = mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay);
mEglContext = mEGLContextFactory.createContext(mEgl, mEglDisplay, mEglConfig);
if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) {
mEglContext = null;
throwEglException("createContext");
}
mEglSurface = null;
}
示例4: makeCurrent
public void makeCurrent()
{
if (null != mEgl && EGL10.EGL_NO_DISPLAY == mEgl.eglGetCurrentDisplay()
&& EGL10.EGL_NO_SURFACE == mEgl.eglGetCurrentSurface(EGL10.EGL_DRAW)
&& EGL10.EGL_NO_SURFACE == mEgl.eglGetCurrentSurface(EGL10.EGL_READ)
&& EGL10.EGL_NO_CONTEXT == mEgl.eglGetCurrentContext()) {
mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext);
}
}
示例5: release
@Override
public void release() {
checkIsNotReleased();
releaseSurface();
detachCurrent();
egl.eglDestroyContext(eglDisplay, eglContext);
egl.eglTerminate(eglDisplay);
eglContext = EGL10.EGL_NO_CONTEXT;
eglDisplay = EGL10.EGL_NO_DISPLAY;
eglConfig = null;
}
示例6: initEGL
@WorkerThread
private void initEGL() {
egl10 = (EGL10) EGLContext.getEGL();
eglDisplay = egl10.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
if (eglDisplay == EGL10.EGL_NO_DISPLAY) {
raiseEGLInitError();
}
int[] majorMinorVersions = new int[2];
if (!egl10.eglInitialize(eglDisplay, majorMinorVersions)) {
raiseEGLInitError();
}
EGLConfig[] eglConfigs = new EGLConfig[1];
int[] numOfConfigs = new int[1];
if (!egl10.eglChooseConfig(eglDisplay, EGL_CONFIG_ATTRIBUTE_LIST, eglConfigs, 1, numOfConfigs)) {
raiseEGLInitError();
}
LogUtil.v(TAG, "createWindowSurface by" + mNativeWindow.get());
eglSurface = egl10.eglCreateWindowSurface(eglDisplay, eglConfigs[0], mNativeWindow.get(), EGL_SURFACE_ATTRIBUTE_LIST);
if (eglSurface == EGL10.EGL_NO_SURFACE) {
raiseEGLInitError();
}
eglContext = egl10.eglCreateContext(eglDisplay, eglConfigs[0], EGL10.EGL_NO_CONTEXT, EGL_CONTEXT_ATTRIBUTE_LIST);
if (eglContext == EGL10.EGL_NO_CONTEXT) {
raiseEGLInitError();
}
if (!egl10.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext)) {
raiseEGLInitError();
}
LogUtil.d(TAG, "initEGL");
}
示例7: shutdownEGL
@WorkerThread
private void shutdownEGL() {
LogUtil.d(TAG, "shutdownEGL");
egl10.eglMakeCurrent(eglDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
egl10.eglDestroyContext(eglDisplay, eglContext);
egl10.eglDestroySurface(eglDisplay, eglSurface);
egl10.eglTerminate(eglDisplay);
eglContext = EGL10.EGL_NO_CONTEXT;
eglSurface = EGL10.EGL_NO_SURFACE;
eglDisplay = EGL10.EGL_NO_DISPLAY;
}
示例8: start
/**
* Initialize EGL for a given configuration spec.
* @param
*/
public void start() {
if (LOG_EGL) {
Log.w("EglHelper", "start() tid=" + Thread.currentThread().getId());
}
/*
* Get an EGL instance
*/
mEgl = (EGL10) EGLContext.getEGL();
/*
* Get to the default display.
*/
mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
if (mEglDisplay == EGL10.EGL_NO_DISPLAY) {
throw new RuntimeException("eglGetDisplay failed");
}
/*
* We can now initialize EGL for that display
*/
int[] version = new int[2];
if(!mEgl.eglInitialize(mEglDisplay, version)) {
throw new RuntimeException("eglInitialize failed");
}
GLTextureView view = mGLSurfaceViewWeakRef.get();
if (view == null) {
mEglConfig = null;
mEglContext = null;
} else {
mEglConfig = view.mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay);
/*
* Create an EGL context. We want to do this as rarely as we can, because an
* EGL context is a somewhat heavy object.
*/
mEglContext = view.mEGLContextFactory.createContext(mEgl, mEglDisplay, mEglConfig);
}
if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) {
mEglContext = null;
throwEglException("createContext");
}
if (LOG_EGL) {
Log.w("EglHelper", "createContext " + mEglContext + " tid=" + Thread.currentThread().getId());
}
mEglSurface = null;
}
示例9: checkIsNotReleased
private void checkIsNotReleased() {
if (eglDisplay == EGL10.EGL_NO_DISPLAY || eglContext == EGL10.EGL_NO_CONTEXT
|| eglConfig == null) {
throw new RuntimeException("This object has been released");
}
}
示例10: start
/**
* Initialize EGL for a given configuration spec.
*/
public void start() {
if (LOG_EGL) {
Log.w("EglHelper", "start() tid=" + Thread.currentThread().getId());
}
/*
* Get an EGL instance
*/
mEgl = (EGL10) EGLContext.getEGL();
/*
* Get to the default display.
*/
mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
if (mEglDisplay == EGL10.EGL_NO_DISPLAY) {
throw new RuntimeException("eglGetDisplay failed");
}
/*
* We can now initialize EGL for that display
*/
int[] version = new int[2];
if (!mEgl.eglInitialize(mEglDisplay, version)) {
throw new RuntimeException("eglInitialize failed");
}
GLSurfaceView view = mGLSurfaceViewWeakRef.get();
if (view == null) {
mEglConfig = null;
mEglContext = null;
} else {
mEglConfig = view.mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay);
/*
* Create an EGL context. We want to do this as rarely as we can, because an
* EGL context is a somewhat heavy object.
*/
mEglContext = view.mEGLContextFactory.createContext(mEgl, mEglDisplay, mEglConfig);
}
if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) {
mEglContext = null;
throwEglException("createContext");
}
if (LOG_EGL) {
Log.w("EglHelper", "createContext " + mEglContext + " tid=" + Thread.currentThread().getId());
}
mEglSurface = null;
}
示例11: start
/**
* Initialize EGL for a given configuration spec.
*/
public void start() {
if (LOG_EGL) {
Log.w("EglHelper", "start() tid=" + Thread.currentThread().getId());
}
/*
* Get an EGL instance
*/
mEgl = (EGL10) EGLContext.getEGL();
/*
* Get to the default display.
*/
mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
if (mEglDisplay == EGL10.EGL_NO_DISPLAY) {
throw new RuntimeException("eglGetDisplay failed");
}
/*
* We can now initialize EGL for that display
*/
int[] version = new int[2];
if (!mEgl.eglInitialize(mEglDisplay, version)) {
throw new RuntimeException("eglInitialize failed");
}
GLTextureView view = mGLTextureViewWeakRef.get();
if (view == null) {
mEglConfig = null;
mEglContext = null;
} else {
mEglConfig = view.mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay);
/*
* Create an EGL context. We want to do this as rarely as we can, because an
* EGL context is a somewhat heavy object.
*/
mEglContext = view.mEGLContextFactory.createContext(mEgl, mEglDisplay, mEglConfig);
}
if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) {
mEglContext = null;
throwEglException("createContext");
}
if (LOG_EGL) {
Log.w("EglHelper", "createContext " + mEglContext + " tid=" + Thread.currentThread().getId());
}
mEglSurface = null;
}
示例12: start
/**
* Initialize EGL for a given configuration spec.
* @param configSpec
*/
public void start(){
Log.v("SDL", "GLSurfaceView_SDL::EglHelper::start(): creating GL context");
/*
* Get an EGL instance
*/
mEgl = (EGL10) EGLContext.getEGL();
/*
* Get to the default display.
*/
mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
/*
* We can now initialize EGL for that display
*/
int[] version = new int[2];
mEgl.eglInitialize(mEglDisplay, version);
mEglConfig = mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay);
if( mEglConfig == null )
Log.e("SDL", "GLSurfaceView_SDL::EglHelper::start(): mEglConfig is NULL");
/*
* Create an OpenGL ES context. This must be done only once, an
* OpenGL context is a somewhat heavy object.
*/
final int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
final int[] gles2_attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
final int[] gles3_attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 3, EGL10.EGL_NONE };
mEglContext = mEgl.eglCreateContext(mEglDisplay, mEglConfig,
EGL10.EGL_NO_CONTEXT,
mEGLConfigChooser.isGles3Required() ? gles3_attrib_list :
mEGLConfigChooser.isGles2Required() ? gles2_attrib_list : null );
if( mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT )
Log.e("SDL", "GLSurfaceView_SDL::EglHelper::start(): mEglContext is EGL_NO_CONTEXT, error: " + mEgl.eglGetError());
mEglSurface = null;
}