Nanashi-soft○プログラマ専用○AndroidでOpenGL ES 2.0プログラミング○
package jp.test;プロジェクト生成時に書かれていた部分はあえて残しておきました
import android.app.Activity;
import android.os.Bundle;
import android.opengl.*;
import javax.microedition.khronos.egl.*;
import javax.microedition.khronos.opengles.*;
public class test extends Activity{
GLSurfaceView glview;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
glview = new GLSurfaceView(this);
glview.setEGLContextClientVersion(2);
glview.setRenderer(new testRenderer());
setContentView(glview);
}
}
class testRenderer implements GLSurfaceView.Renderer{
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
}
public void onSurfaceChanged(GL10 gl, int w, int h) {
}
public void onDrawFrame(GL10 gl) {
GLES20.glClearColor(0.0f, 0.0f, 1.0f, 1);
GLES20.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
}
}