21 package com.arm.malideveloper.openglessdk.mipmapping;
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;
34 private static String
LOGTAG =
"Mipmapping";
37 protected void onCreate(Bundle savedInstanceState)
39 super.onCreate(savedInstanceState);
40 String privateAssetDirectory = getFilesDir().getAbsolutePath();
42 String textureName =
"level0.raw";
44 textureName =
"level1.raw";
46 textureName =
"level2.raw";
48 textureName =
"level3.raw";
50 textureName =
"level4.raw";
52 textureName =
"level5.raw";
54 textureName =
"level6.raw";
56 textureName =
"level7.raw";
58 textureName =
"level8.raw";
60 textureName =
"level9.raw";
62 textureName =
"level0.pkm";
64 textureName =
"level1.pkm";
66 textureName =
"level2.pkm";
68 textureName =
"level3.pkm";
70 textureName =
"level4.pkm";
72 textureName =
"level5.pkm";
74 textureName =
"level6.pkm";
76 textureName =
"level7.pkm";
78 textureName =
"level8.pkm";
80 textureName =
"level9.pkm";
88 graphicsView.onPause();
93 graphicsView.onResume();
97 File fileTest =
new File(assetPath, assetName);
101 Log.d(
LOGTAG, assetName +
" already exists no extraction needed\n");
105 Log.d(
LOGTAG, assetName +
" doesn't exist extraction needed \n");
108 RandomAccessFile out =
new RandomAccessFile(fileTest,
"rw");
109 AssetManager am = getResources().getAssets();
111 InputStream inputStream = am.open(assetName);
112 byte
buffer[] =
new byte[1024];
118 count = inputStream.read(
buffer, 0, 1024);
125 Log.e(
LOGTAG,
"Failure in extractAssets(): " + e.toString() +
" " + assetPath+assetName);
127 if(fileTest.exists())
129 Log.d(
LOGTAG,
"File Extracted successfully");
TutorialView graphicsView
void extractAsset(String assetName, String assetPath)
GLenum GLenum GLsizei count
void onCreate(Bundle savedInstanceState)