21 package com.arm.malideveloper.openglessdk.highqualitytextjava;
25 import android.app.Activity;
26 import android.opengl.GLSurfaceView;
27 import android.os.Bundle;
28 import android.content.*;
29 import android.view.*;
38 public void onCreate(Bundle savedInstanceState) {
39 super.onCreate(savedInstanceState);
45 setContentView(GLES20SurfaceView);
51 GLES20SurfaceView.onPause();
57 GLES20SurfaceView.onResume();
61 class HighQualityTextSurfaceView
extends GLSurfaceView {
63 private HighQualityTextRenderer theRenderer =
new HighQualityTextRenderer();
64 private float prevX = 0.0f;
65 private float prevY = 0.0f;
67 public HighQualityTextSurfaceView(Context context){
70 setEGLConfigChooser(
false);
72 setEGLContextClientVersion(2);
74 setRenderer(theRenderer);
77 public boolean onTouchEvent (MotionEvent event) {
78 if (event.getAction() == MotionEvent.ACTION_DOWN) {
79 prevX = event.getRawX();
80 prevY = event.getRawY();
81 theRenderer.touchDown(prevX, prevY);
83 if (event.getAction() == MotionEvent.ACTION_UP) {
84 theRenderer.touchUp(event.getRawX(), event.getRawY());
86 if (event.getAction() == MotionEvent.ACTION_MOVE) {
87 float x = event.getRawX();
88 float y = event.getRawY();
89 theRenderer.touchMove(
x,
y, prevX, prevY);
GLSurfaceView GLES20SurfaceView
void onCreate(Bundle savedInstanceState)
GLint GLint GLint GLint GLint x