Code example for EGL10

Methods: eglCreateContexteglGetDisplayeglInitialize

0
	public void start() { 
		/* Get an EGL instance. */ 
		this.mEGL = (EGL10) EGLContext.getEGL();
 
		/* Get to the default display. */ 
		this.mEGLDisplay = this.mEGL.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
 
		/* We can now initialize EGL for that display. */ 
		final int[] version = new int[2];
		if(!this.mEGL.eglInitialize(this.mEGLDisplay, version)) {
			throw new AndEngineRuntimeException(EGLHelper.class.getSimpleName() + ".eglInitialize failed." + " @(Thread: '" + Thread.currentThread().getName() + "')");
		} 
		this.mEGLConfig = this.mEGLConfigChooser.chooseConfig(this.mEGL, this.mEGLDisplay);
 
		/* Create an OpenGL ES context. This must be done only once, an OpenGL context is a somewhat heavy object. */ 
		this.mEGLContext = this.mEGL.eglCreateContext(this.mEGLDisplay, this.mEGLConfig, EGL10.EGL_NO_CONTEXT, EGLHelper.EGL_ATTRIBUTES);
		if (this.mEGLContext == null || this.mEGLContext == EGL10.EGL_NO_CONTEXT) {
			throw new RuntimeException("createContext failed");
		} 
 
		this.mEGLSurface = null;
Contextual code suggestions in your IDE  Get Codota for Java