21 package com.arm.malideveloper.openglessdk.proceduralgeometry;
23 import android.content.res.AssetManager;
24 import android.app.Activity;
25 import android.os.Bundle;
26 import android.util.Log;
27 import android.view.WindowManager;
30 import java.io.InputStream;
31 import java.io.RandomAccessFile;
35 ProceduralGeometryView mView;
38 private static String
LOGTAG =
"ProceduralGeometry";
40 @Override
protected void onCreate(Bundle savedInstanceState) {
41 super.onCreate(savedInstanceState);
42 mView =
new ProceduralGeometryView(getApplication());
43 setContentView(mView);
76 Log.d(
LOGTAG, assetName +
" already exists. No extraction needed.\n");
78 Log.d(
LOGTAG, assetName +
" doesn't exist. Extraction needed. \n");
81 RandomAccessFile randomAccessFile =
new RandomAccessFile(
assetsDirectory + assetName,
"rw");
82 AssetManager assetManager = applicationContext.getResources().getAssets();
83 InputStream inputStream = assetManager.open(assetName);
85 byte
buffer[] =
new byte[1024];
91 count = inputStream.read(
buffer, 0, 1024);
94 randomAccessFile.close();
96 }
catch(Exception e) {
101 Log.d(
LOGTAG,
"File extracted successfully");
106 public static native
void init();
108 public static native
void step();
113 System.loadLibrary(
"Native");
void onCreate(Bundle savedInstanceState)
GLint GLsizei GLsizei height
static android.content.Context applicationContext
GLenum GLenum GLsizei count
static native void init()
static String assetsDirectory
void extractAsset(String assetName)
GLint GLint GLint GLint GLint x
static native void step()
static native void resize(int width, int height)
static native void onpointerup(float x, float y)
static native void onpointerdown(float x, float y)