init OpenGL GLSurfaceView - Android android.opengl

Android examples for android.opengl:OpenGL

Description

init OpenGL GLSurfaceView

Demo Code


//package com.java2s;

import android.app.Activity;

import android.opengl.GLSurfaceView;

import android.util.Log;

public class Main {

    private static Activity targetActivity;

    public static GLSurfaceView initGLES20(Activity activity,
            GLSurfaceView.Renderer renderer) {
        targetActivity = activity;//from w  w  w .  j a  va2s.com
        GLSurfaceView glSurfaceView = new GLSurfaceView(activity); 

        glSurfaceView.setEGLContextClientVersion(2);
        glSurfaceView.setRenderer(renderer);


        return glSurfaceView;
    }
}

Related Tutorials