当前位置: 首页>>代码示例>>Java>>正文


Java EGL10.EGL_NO_CONTEXT属性代码示例

本文整理汇总了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;
}
 
开发者ID:nextgis,项目名称:android_nextgis_mobile,代码行数:16,代码来源:MapGlView.java

示例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;
}
 
开发者ID:hoanganhtuan95ptit,项目名称:EditPhoto,代码行数:17,代码来源:ImageEglSurface.java

示例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;
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:22,代码来源:EGL.java

示例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);
    }
}
 
开发者ID:nextgis,项目名称:android_nextgis_mobile,代码行数:9,代码来源:MapDrawing.java

示例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;
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:11,代码来源:EglBase10.java

示例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");
}
 
开发者ID:TedaLIEz,项目名称:ParsingPlayer,代码行数:35,代码来源:VideoRenderThread.java

示例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;
}
 
开发者ID:TedaLIEz,项目名称:ParsingPlayer,代码行数:11,代码来源:VideoRenderThread.java

示例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;
}
 
开发者ID:pavelsemak,项目名称:alpha-movie,代码行数:52,代码来源:GLTextureView.java

示例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");
  }
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:6,代码来源:EglBase10.java

示例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;
}
 
开发者ID:uestccokey,项目名称:EZFilter,代码行数:51,代码来源:GLSurfaceView.java

示例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;
}
 
开发者ID:uestccokey,项目名称:EZFilter,代码行数:51,代码来源:GLTextureView.java

示例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;
}
 
开发者ID:NeoTerm,项目名称:NeoTerm,代码行数:44,代码来源:GLSurfaceView_SDL.java


注:本文中的javax.microedition.khronos.egl.EGL10.EGL_NO_CONTEXT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。