create a instance of OpenGL EGLConfig - Android android.opengl

Android examples for android.opengl:OpenGL

Description

create a instance of OpenGL EGLConfig

Demo Code


//package com.java2s;
import java.lang.reflect.Constructor;

import android.opengl.EGLConfig;

public class Main {
    private static Constructor<EGLConfig> ctorEGLConfig;

    /**//  w  w  w .  j av  a2  s.  c om
     * create a instance of {@link EGLConfig}
     * @param handle native long handle
     * @return EGLConfig instance
     */
    public static EGLConfig createEGLConfig(long handle) {
        if (handle == 0)
            return null;
        try {
            EGLConfig cfg = ctorEGLConfig.newInstance(handle);
            return cfg;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related Tutorials