Revision 8982b894
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/examples/meshjoin/MeshJoinActivity.java | ||
---|---|---|
20 | 20 |
package org.distorted.examples.meshjoin; |
21 | 21 |
|
22 | 22 |
import android.app.Activity; |
23 |
import android.opengl.GLSurfaceView; |
|
23 | 24 |
import android.os.Bundle; |
25 |
import android.view.View; |
|
26 |
import android.widget.CheckBox; |
|
24 | 27 |
|
28 |
import org.distorted.examples.R; |
|
25 | 29 |
import org.distorted.library.main.DistortedLibrary; |
26 | 30 |
|
27 | 31 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
28 | 32 |
|
29 | 33 |
public class MeshJoinActivity extends Activity |
30 | 34 |
{ |
31 |
private MeshJoinSurfaceView mView; |
|
32 |
|
|
33 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
34 |
|
|
35 | 35 |
@Override |
36 | 36 |
protected void onCreate(Bundle icicle) |
37 | 37 |
{ |
38 | 38 |
super.onCreate(icicle); |
39 |
mView = new MeshJoinSurfaceView(this); |
|
40 |
setContentView(mView); |
|
39 |
setContentView(R.layout.meshjoinlayout); |
|
41 | 40 |
} |
42 | 41 |
|
43 | 42 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
45 | 44 |
@Override |
46 | 45 |
protected void onPause() |
47 | 46 |
{ |
48 |
mView.onPause(); |
|
47 |
GLSurfaceView view = this.findViewById(R.id.meshjoinSurfaceView); |
|
48 |
view.onPause(); |
|
49 | 49 |
DistortedLibrary.onPause(); |
50 | 50 |
super.onPause(); |
51 | 51 |
} |
... | ... | |
56 | 56 |
protected void onResume() |
57 | 57 |
{ |
58 | 58 |
super.onResume(); |
59 |
mView.onResume(); |
|
59 |
GLSurfaceView view = this.findViewById(R.id.meshjoinSurfaceView); |
|
60 |
view.onResume(); |
|
60 | 61 |
} |
61 | 62 |
|
62 | 63 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
67 | 68 |
DistortedLibrary.onDestroy(); |
68 | 69 |
super.onDestroy(); |
69 | 70 |
} |
70 |
|
|
71 |
|
|
72 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
73 |
|
|
74 |
public void onClick(View view) |
|
75 |
{ |
|
76 |
CheckBox box = (CheckBox)view; |
|
77 |
int id = box.getId(); |
|
78 |
boolean checked = box.isChecked(); |
|
79 |
MeshJoinSurfaceView sView = findViewById(R.id.meshjoinSurfaceView); |
|
80 |
|
|
81 |
switch(id) |
|
82 |
{ |
|
83 |
case R.id.meshjoinCheckBox0 : sView.getRenderer().setChecked(0,checked); break; |
|
84 |
case R.id.meshjoinCheckBox1 : sView.getRenderer().setChecked(1,checked); break; |
|
85 |
case R.id.meshjoinCheckBox2 : sView.getRenderer().setChecked(2,checked); break; |
|
86 |
case R.id.meshjoinCheckBox3 : sView.getRenderer().setChecked(3,checked); break; |
|
87 |
} |
|
88 |
} |
|
71 | 89 |
} |
Also available in: Unified diff
Progress with MeshJoin.