21 package com.arm.malideveloper.openglessdk.proceduralgeometry;
23 import android.content.Context;
24 import android.graphics.PixelFormat;
25 import android.opengl.GLSurfaceView;
26 import android.util.AttributeSet;
27 import android.util.Log;
28 import android.view.KeyEvent;
29 import android.view.MotionEvent;
31 import javax.microedition.khronos.egl.EGL10;
32 import javax.microedition.khronos.egl.EGLConfig;
33 import javax.microedition.khronos.egl.EGLContext;
34 import javax.microedition.khronos.egl.EGLDisplay;
35 import javax.microedition.khronos.opengles.GL10;
37 class ProceduralGeometryView
extends GLSurfaceView {
38 private static final String TAG =
"ProceduralGeometry";
39 private static final boolean DEBUG =
true;
41 public ProceduralGeometryView(Context context) {
43 setEGLConfigChooser(8, 8, 8, 0, 16, 0);
44 setEGLContextClientVersion(2);
45 setRenderer(
new Renderer());
48 public boolean onTouchEvent(MotionEvent event)
50 float x = event.getRawX();
51 float y = event.getRawY();
53 if (event.getAction() == MotionEvent.ACTION_UP)
54 ProceduralGeometry.onpointerup(x, y);
55 else if (event.getAction() == MotionEvent.ACTION_MOVE)
56 ProceduralGeometry.onpointerdown(x, y);
62 ProceduralGeometry.step();
70 ProceduralGeometry.init();
GLint GLsizei GLsizei height
GLint GLint GLint GLint GLint x
void onSurfaceCreated(GL10 gl, EGLConfig config)
void onDrawFrame(GL10 gl)
void onSurfaceChanged(GL10 gl, int width, int height)