21 package com.arm.malideveloper.openglessdk.instancedTessellation;
24 import java.io.InputStream;
25 import java.io.RandomAccessFile;
27 import android.os.Bundle;
28 import android.app.Activity;
29 import android.content.res.AssetManager;
30 import android.util.Log;
35 private static String
LOGTAG =
"InstancedTessellation";
41 protected void onCreate(Bundle savedInstanceState)
43 super.onCreate(savedInstanceState);
51 extractAsset(
"Instanced_Tessellation_Instanced_shader.frag");
52 extractAsset(
"Instanced_Tessellation_Instanced_shader.vert");
53 extractAsset(
"Instanced_Tessellation_Wireframe_shader.frag");
54 extractAsset(
"Instanced_Tessellation_Wireframe_shader.vert");
57 setContentView(graphicsView);
62 graphicsView.onPause();
67 graphicsView.onResume();
80 Log.d(
LOGTAG,assetName +
" already exists. No extraction needed.\n");
84 Log.d(
LOGTAG, assetName +
" doesn't exist. Extraction needed. \n");
89 RandomAccessFile out =
new RandomAccessFile(
assetDirectory + assetName,
"rw");
90 AssetManager am = applicationContext.getResources().getAssets();
93 InputStream inputStream = am.open(assetName);
94 byte
buffer[] =
new byte[1024];
100 count = inputStream.read(
buffer, 0, 1024);
110 if(fileTest.exists())
112 Log.d(
LOGTAG,
"File extracted successfully");
static String assetDirectory
void onCreate(Bundle savedInstanceState)
GLenum GLenum GLsizei count
void extractAsset(String assetName)
static android.content.Context applicationContext
TutorialView graphicsView