create a instance of OpenGL EGLDisplay - Android android.opengl

Android examples for android.opengl:OpenGL

Description

create a instance of OpenGL EGLDisplay

Demo Code


import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.Map;
import android.opengl.EGL14;
import android.opengl.EGLConfig;
import android.opengl.EGLContext;
import android.opengl.EGLDisplay;
import android.opengl.EGLSurface;

public class Main{
    private static Constructor<EGLDisplay> ctorEGLDisplay;
    /**/*w ww  .ja  v a2s  .  c  o  m*/
     * create a instance of EGLDisplay
     * @param handle native long handle
     * @return EGLDisplay instance
     */
    public static EGLDisplay createEGLDisplay(long handle) {
        if (handle == 0)
            return EGLDisplay.getNullEGLDisplay();
        try {
            EGLDisplay dsp = ctorEGLDisplay.newInstance(handle);
            return dsp;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related Tutorials