Revision 099d8f8b
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/examples/meshfile/MeshFileActivity.java | ||
---|---|---|
83 | 83 |
super.onResume(); |
84 | 84 |
GLSurfaceView view = this.findViewById(R.id.meshfileSurfaceView); |
85 | 85 |
view.onResume(); |
86 |
|
|
87 |
if( mResource!=0 ) Open(null); |
|
86 | 88 |
} |
87 | 89 |
|
88 | 90 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java | ||
---|---|---|
55 | 55 |
private DistortedScreen mScreen; |
56 | 56 |
private DistortedEffects mEffects; |
57 | 57 |
private Static3D mScale; |
58 |
private MeshBase mMesh; |
|
59 | 58 |
private long mTime; |
60 | 59 |
private int mBytes; |
61 | 60 |
private int mVertices; |
... | ... | |
128 | 127 |
|
129 | 128 |
void open(int resourceID) |
130 | 129 |
{ |
130 |
if( mTexture==null ) mTexture = new DistortedTexture(); |
|
131 | 131 |
mTexture.setTexture( createTexture(resourceID) ); |
132 | 132 |
|
133 | 133 |
long t1 = System.currentTimeMillis(); |
134 |
mMesh = createMesh(resourceID);
|
|
134 |
MeshBase mesh = createMesh(resourceID);
|
|
135 | 135 |
long t2 = System.currentTimeMillis(); |
136 | 136 |
|
137 | 137 |
mTime = t2-t1; |
138 | 138 |
|
139 | 139 |
mScreen.detachAll(); |
140 |
mScreen.attach(mTexture,mEffects,mMesh);
|
|
140 |
mScreen.attach(mTexture,mEffects,mesh); |
|
141 | 141 |
} |
142 | 142 |
|
143 | 143 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Make the MeshFile app survive a period of being paused.