Revision 48c88f57
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java | ||
---|---|---|
56 | 56 |
private DistortedEffects mEffects; |
57 | 57 |
private Static3D mScale; |
58 | 58 |
private MeshBase mMesh; |
59 |
private long mTime; |
|
60 |
private int mBytes; |
|
61 |
private int mVertices; |
|
59 | 62 |
|
60 | 63 |
Static4D mQuat1, mQuat2; |
61 | 64 |
int mScreenMin; |
... | ... | |
84 | 87 |
mEffects.apply( new MatrixEffectScale(mScale)); |
85 | 88 |
|
86 | 89 |
mScreen.glClearColor(1.0f, 1.0f, 1.0f, 1.0f); |
90 |
mScreen.showFPS(); |
|
87 | 91 |
} |
88 | 92 |
|
89 | 93 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
130 | 134 |
mMesh = createMesh(resourceID); |
131 | 135 |
long t2 = System.currentTimeMillis(); |
132 | 136 |
|
133 |
android.util.Log.e("file", "time: "+(t2-t1));
|
|
137 |
mTime = t2-t1;
|
|
134 | 138 |
|
135 | 139 |
mScreen.detachAll(); |
136 | 140 |
mScreen.attach(mTexture,mEffects,mMesh); |
... | ... | |
276 | 280 |
Resources res = con.getResources(); |
277 | 281 |
InputStream is = res.openRawResource(resourceID); |
278 | 282 |
DataInputStream dos = new DataInputStream(is); |
279 |
MeshBase mesh = new MeshFile(dos); |
|
283 |
MeshFile mesh = new MeshFile(dos); |
|
284 |
|
|
285 |
mBytes = mesh.getNumBytes(); |
|
286 |
mVertices = mesh.getNumVertices(); |
|
280 | 287 |
|
281 | 288 |
try |
282 | 289 |
{ |
... | ... | |
284 | 291 |
} |
285 | 292 |
catch(IOException e) |
286 | 293 |
{ |
287 |
android.util.Log.e("meshFile", "Error closing InputStream: "+e.toString());
|
|
294 |
android.util.Log.e("MeshFile", "Error closing InputStream: "+e.toString());
|
|
288 | 295 |
} |
289 | 296 |
|
290 | 297 |
return mesh; |
291 | 298 |
} |
299 |
|
|
300 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
301 |
|
|
302 |
long getTime() |
|
303 |
{ |
|
304 |
return mTime; |
|
305 |
} |
|
306 |
|
|
307 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
308 |
|
|
309 |
int getBytes() |
|
310 |
{ |
|
311 |
return mBytes; |
|
312 |
} |
|
313 |
|
|
314 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
315 |
|
|
316 |
int getVertices() |
|
317 |
{ |
|
318 |
return mVertices; |
|
319 |
} |
|
292 | 320 |
} |
Also available in: Unified diff
Progress with the MeshFile app.