Revision 42f65cb4
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/examples/deform/DeformActivity.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
import org.distorted.library.main.Distorted; |
23 | 23 |
import org.distorted.examples.R; |
24 |
import org.distorted.library.EffectNames;
|
|
24 |
import org.distorted.library.effect.EffectName;
|
|
25 | 25 |
|
26 | 26 |
import android.app.Activity; |
27 | 27 |
import android.opengl.GLSurfaceView; |
... | ... | |
37 | 37 |
public class DeformActivity extends Activity implements OnSeekBarChangeListener |
38 | 38 |
{ |
39 | 39 |
private TextView textR; |
40 |
private EffectNames mCurrEffect;
|
|
40 |
private EffectName mCurrEffect; |
|
41 | 41 |
|
42 | 42 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
43 | 43 |
|
... | ... | |
98 | 98 |
public void Distort(View v) |
99 | 99 |
{ |
100 | 100 |
DeformSurfaceView view = (DeformSurfaceView) this.findViewById(R.id.deformSurfaceView); |
101 |
view.getRenderer().setMode(EffectNames.DISTORT);
|
|
102 |
mCurrEffect = EffectNames.DISTORT;
|
|
101 |
view.getRenderer().setMode(EffectName.DISTORT); |
|
102 |
mCurrEffect = EffectName.DISTORT; |
|
103 | 103 |
} |
104 | 104 |
|
105 | 105 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
107 | 107 |
public void Deform(View v) |
108 | 108 |
{ |
109 | 109 |
DeformSurfaceView view = (DeformSurfaceView) this.findViewById(R.id.deformSurfaceView); |
110 |
view.getRenderer().setMode(EffectNames.DEFORM);
|
|
111 |
mCurrEffect = EffectNames.DEFORM;
|
|
110 |
view.getRenderer().setMode(EffectName.DEFORM); |
|
111 |
mCurrEffect = EffectName.DEFORM; |
|
112 | 112 |
} |
113 | 113 |
|
114 | 114 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
116 | 116 |
public void Shear(View v) |
117 | 117 |
{ |
118 | 118 |
DeformSurfaceView view = (DeformSurfaceView) this.findViewById(R.id.deformSurfaceView); |
119 |
view.getRenderer().setMode(EffectNames.SHEAR);
|
|
120 |
mCurrEffect = EffectNames.SHEAR;
|
|
119 |
view.getRenderer().setMode(EffectName.SHEAR); |
|
120 |
mCurrEffect = EffectName.SHEAR; |
|
121 | 121 |
} |
122 | 122 |
|
123 | 123 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
138 | 138 |
|
139 | 139 |
int effect = savedInstanceState.getInt("effect"); |
140 | 140 |
|
141 |
if( effect == EffectNames.DISTORT.ordinal() ) Distort(null);
|
|
142 |
if( effect == EffectNames.DEFORM.ordinal() ) Deform(null);
|
|
143 |
if( effect == EffectNames.SHEAR.ordinal() ) Shear(null);
|
|
141 |
if( effect == EffectName.DISTORT.ordinal() ) Distort(null); |
|
142 |
if( effect == EffectName.DEFORM.ordinal() ) Deform(null); |
|
143 |
if( effect == EffectName.SHEAR.ordinal() ) Shear(null); |
|
144 | 144 |
} |
145 | 145 |
|
146 | 146 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Further progress with Apps.