Java 8 EGLContext - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 EGLContext class.

This code example shows how to use the following methods:getGL
		if (this.mEGLSurface == null || this.mEGLSurface == EGL10.EGL_NO_SURFACE) {
			throw new RuntimeException("createSurface failed");
		} 
 
		/* Before we can issue GL commands, we need to make sure the context is current and bound to a surface. */ 
		if (!this.mEGL.eglMakeCurrent(this.mEGLDisplay, this.mEGLSurface, this.mEGLSurface, this.mEGLContext)) {
			throw new RuntimeException("eglMakeCurrent failed.");
		} 
 
		return this.mEGLContext.getGL();
	} 
 
	/** 
	 * Display the current render surface. 
	 *  
	 * @return false if the context has been lost. 
	 */ 
	public boolean swapBuffers() { 
		this.mEGL.eglSwapBuffers(this.mEGLDisplay, this.mEGLSurface);
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getGL
                } 
                throw new RuntimeException("createWindowSurface failed "
                        + GLUtils.getEGLErrorString(error));
            } 
 
            if (!mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)) {
                throw new RuntimeException("eglMakeCurrent failed "
                        + GLUtils.getEGLErrorString(mEgl.eglGetError()));
            } 
 
            mGL = mEglContext.getGL();
        } 
         
 
        EGLContext createContext(EGL10 egl, EGLDisplay eglDisplay, EGLConfig eglConfig) {
            int[] attrib_list = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
            return egl.eglCreateContext(eglDisplay, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);            
        } 
 
        private EGLConfig chooseEglConfig() {
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getGL
                    mEglDisplay, mEglConfig, mMosaicOutputSurfaceTexture, null);
            if (mEglSurface == null || mEglSurface == EGL10.EGL_NO_SURFACE) {
                throw new RuntimeException("failed to createWindowSurface");
            } 
 
            if (!mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)) {
                throw new RuntimeException("failed to eglMakeCurrent");
            } 
 
            mGl = (GL10) mEglContext.getGL();
 
            mInputSurfaceTexture = new SurfaceTexture(MosaicRenderer.init());
            MosaicRenderer.reset(mWidth, mHeight, mIsLandscape);
        } 
 
        private void doRelease() { 
            mEgl.eglDestroySurface(mEglDisplay, mEglSurface);
            mEgl.eglDestroyContext(mEglDisplay, mEglContext);
            mEgl.eglMakeCurrent(mEglDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE,
                    EGL10.EGL_NO_CONTEXT);
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getGL
 
		/* 
		 * Before we can issue GL commands, we need to make sure the context is 
		 * current and bound to a surface. 
		 */ 
		if (!this.mEgl.eglMakeCurrent(this.mEglDisplay, this.mEglSurface, this.mEglSurface, this.mEglContext)) {
			throw new RuntimeException("eglMakeCurrent failed.");
		} 
 
		GL gl = this.mEglContext.getGL();
		if (this.mGLWrapper != null) {
			gl = this.mGLWrapper.wrap(gl);
		} 
 
		/* 
		 * if ((mDebugFlags & (DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS))!= 0) 
		 * { int configFlags = 0; Writer log = null; if ((mDebugFlags & 
		 * DEBUG_CHECK_GL_ERROR) != 0) { configFlags |= 
		 * GLDebugHelper.CONFIG_CHECK_GL_ERROR; } if ((mDebugFlags & 
		 * DEBUG_LOG_GL_CALLS) != 0) { log = new LogWriter(); } gl = 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getGL
       
			/* 
			 * Before we can issue GL commands, we need to make sure  
			 * the context is current and bound to a surface. 
			 */ 
			egl.eglMakeCurrent(dpy, surface, surface, context);
			 
			/* 
			 * Get to the appropriate GL interface. 
			 * This is simply done by casting the GL context to either 
			 * GL10 or GL11. 
			 */ 
			gl = (GL10)context.getGL();
                
			/* 
			 * By default, OpenGL enables features that improve quality 
			 * but reduce performance. One might want to tweak that 
			 * especially on software renderer. 
			 */ 
			gl.glDisable(GL10.GL_DITHER);
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:equals
            mEgl.eglDestroySurface(mEglDisplay, mEglSurface);
        } 
    } 
 
    private void checkCurrent() { 
        if (!mEglContext.equals(mEgl.eglGetCurrentContext()) ||
                !mEglSurface.equals(mEgl.eglGetCurrentSurface(EGL10.EGL_DRAW))) {
            if (!mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)) {
                throw new RuntimeException("eglMakeCurrent failed "
                        + GLUtils.getEGLErrorString(mEgl.eglGetError()));
            } 
        } 
    } 
 
    private EGLConfig chooseEglConfig() {
        int[] configsCount = new int[1];
        EGLConfig[] configs = new EGLConfig[1];
        if (!mEgl.eglChooseConfig(mEglDisplay, sEglConfig, configs, 1, configsCount)) {
            throw new IllegalArgumentException("eglChooseConfig failed " +
                    GLUtils.getEGLErrorString(mEgl.eglGetError()));
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getGL
 
    public void setGLVersion(int version) {
        mGLVersion = version;
    } 
 
    public GL getGL()                       { return mEGLContext.getGL(); }
    public EGLDisplay getEGLDisplay()       { return mEGLDisplay;         }
    public EGLConfig getEGLConfig()         { return mEGLConfig;          }
    public EGLContext getEGLContext()       { return mEGLContext;         }
    public EGLSurface getEGLSurface()       { return mEGLSurface;         }
    public LayerView getView()              { return mView;               }
 
    public boolean hasSurface() { 
        return mEGLSurface != null;
    } 
 
    public boolean swapBuffers() { 
        return mEGL.eglSwapBuffers(mEGLDisplay, mEGLSurface);
    } 
 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getGL
 
		/* 
		 * Before we can issue GL commands, we need to make sure the context is 
		 * current and bound to a surface. 
		 */ 
		if (!this.mEgl.eglMakeCurrent(this.mEglDisplay, this.mEglSurface, this.mEglSurface, this.mEglContext)) {
			throw new RuntimeException("eglMakeCurrent failed.");
		} 
 
		GL gl = this.mEglContext.getGL();
		if (this.mGLWrapper != null) {
			gl = this.mGLWrapper.wrap(gl);
		} 
 
		/* 
		 * if ((mDebugFlags & (DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS))!= 0) 
		 * { int configFlags = 0; Writer log = null; if ((mDebugFlags & 
		 * DEBUG_CHECK_GL_ERROR) != 0) { configFlags |= 
		 * GLDebugHelper.CONFIG_CHECK_GL_ERROR; } if ((mDebugFlags & 
		 * DEBUG_LOG_GL_CALLS) != 0) { log = new LogWriter(); } gl = 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getGL
            int error = mEgl.eglGetError();
            Log.e(LOG_TAG,"createWindowSurface returned error");
            return false; 
        } 
 
        if (!mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)) {
            Log.e(LOG_TAG, "eglMakeCurrent failed " +
                    GLUtils.getEGLErrorString(mEgl.eglGetError()));
            return false; 
        } 
 
        mGL = (GL10) mEglContext.getGL();
 
        return true; 
    } 
 
    private void finishGL() { 
        if (mEgl == null || mEglDisplay == null) {
            // Nothing to free 
            return; 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getGL
 
            /* 
             * Before we can issue GL commands, we need to make sure 
             * the context is current and bound to a surface. 
             */ 
            mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface,
                    mEglContext);
 
 
            GL gl = mEglContext.getGL();
            if (mGLWrapper != null) {
                gl = mGLWrapper.wrap(gl);
            } 
            return gl;
        } 
 
        /** 
         * Display the current render surface. 
         * @return false if the context has been lost. 
         */ 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 EGLContext Methods: