Revision 77e66c58
Added by Leszek Koltunski 11 months ago
src/main/java/org/distorted/examples/singlemesh/SingleMeshActivity.java | ||
---|---|---|
76 | 76 |
{ |
77 | 77 |
Button butt = (Button)view; |
78 | 78 |
int id = butt.getId(); |
79 |
SingleMeshSurfaceView sView = findViewById(R.id.singlemeshSurfaceView); |
|
79 |
SingleMeshSurfaceView v = findViewById(R.id.singlemeshSurfaceView); |
|
80 |
SingleMeshRenderer r = v.getRenderer(); |
|
80 | 81 |
|
81 |
switch(id) |
|
82 |
{ |
|
83 |
case R.id.singlemeshButtonLX : sView.getRenderer().apply( (1<<4) + (0<<2) + 0, 0 ); break; |
|
84 |
case R.id.singlemeshButtonRX : sView.getRenderer().apply( (2<<4) + (0<<2) + 0, 0 ); break; |
|
85 |
case R.id.singlemeshButtonLY : sView.getRenderer().apply( (0<<4) + (1<<2) + 0, 1 ); break; |
|
86 |
case R.id.singlemeshButtonRY : sView.getRenderer().apply( (0<<4) + (2<<2) + 0, 1 ); break; |
|
87 |
case R.id.singlemeshButtonLZ : sView.getRenderer().apply( (0<<4) + (0<<2) + 1, 2 ); break; |
|
88 |
case R.id.singlemeshButtonRZ : sView.getRenderer().apply( (0<<4) + (0<<2) + 2, 2 ); break; |
|
89 |
} |
|
82 |
if( id == R.id.singlemeshButtonLX ) r.apply( (1<<4) + (0<<2) + 0, 0 ); |
|
83 |
if( id == R.id.singlemeshButtonRX ) r.apply( (2<<4) + (0<<2) + 0, 0 ); |
|
84 |
if( id == R.id.singlemeshButtonLY ) r.apply( (0<<4) + (1<<2) + 0, 1 ); |
|
85 |
if( id == R.id.singlemeshButtonRY ) r.apply( (0<<4) + (2<<2) + 0, 1 ); |
|
86 |
if( id == R.id.singlemeshButtonLZ ) r.apply( (0<<4) + (0<<2) + 1, 2 ); |
|
87 |
if( id == R.id.singlemeshButtonRZ ) r.apply( (0<<4) + (0<<2) + 2, 2 ); |
|
90 | 88 |
} |
91 | 89 |
} |
Also available in: Unified diff
in API 34 R.id. things are no loger constants and cannot be used in switches.