Project

General

Profile

« Previous | Next » 

Revision 42d910b3

Added by Leszek Koltunski almost 4 years ago

Convert AroundTheWorld to stretchless API.

View differences:

src/main/java/org/distorted/examples/movingeffects/MovingEffectsSurfaceView.java
29 29
import android.view.MotionEvent;
30 30
import android.util.AttributeSet;
31 31

  
32
import org.distorted.library.effect.EffectType;
33 32
import org.distorted.library.effect.FragmentEffectAlpha;
34 33
import org.distorted.library.effect.FragmentEffectChroma;
35 34
import org.distorted.library.effect.VertexEffectDeform;
36 35
import org.distorted.library.effect.VertexEffectSink;
37 36
import org.distorted.library.effect.VertexEffectSwirl;
38
import org.distorted.library.main.DistortedEffects;
39 37
import org.distorted.library.type.Dynamic3D;
40 38
import org.distorted.library.type.Static1D;
41 39
import org.distorted.library.type.Static3D;
......
117 115

  
118 116
    public void onSurfaceChanged(int width,int height)
119 117
      {
120
      int max = width>height ? width:height;
118
      int max = Math.max(width, height);
121 119

  
122 120
      mScrWidth  = width;
123 121
      mScrHeight = height;
......
143 141
      
144 142
      synchronized(lock)
145 143
        {
146
        DistortedEffects q = mRenderer.getEffects();
147
        q.abortByType(EffectType.VERTEX);
148
        q.abortByType(EffectType.FRAGMENT);
149
        q.apply(mEffectDeform);
144
        mRenderer.apply(mEffectDeform);
150 145
        mCurrEffect = EFFECT_BUBBLE;
151 146
        }
152 147
      }
......
159 154
         
160 155
      synchronized(lock)
161 156
        {
162
        DistortedEffects q = mRenderer.getEffects();
163
        q.abortByType(EffectType.VERTEX);
164
        q.abortByType(EffectType.FRAGMENT);
165
        q.apply(mEffectSink);
157
        mRenderer.apply(mEffectSink);
166 158
        mCurrEffect = EFFECT_SINK;
167 159
        }
168 160
      }
......
175 167
         
176 168
      synchronized(lock)
177 169
        {
178
        DistortedEffects q = mRenderer.getEffects();
179
        q.abortByType(EffectType.VERTEX);
180
        q.abortByType(EffectType.FRAGMENT);
181
        q.apply(mEffectChroma);
170
        mRenderer.apply(mEffectChroma);
182 171
        mCurrEffect = EFFECT_CHROMA;
183 172
        }
184 173
      }
......
191 180
      
192 181
      synchronized(lock)
193 182
        {
194
        DistortedEffects q = mRenderer.getEffects();
195
        q.abortByType(EffectType.VERTEX);
196
        q.abortByType(EffectType.FRAGMENT);
197
        q.apply(mEffectAlpha);
183
        mRenderer.apply(mEffectAlpha);
198 184
        mCurrEffect = EFFECT_TRANS;
199 185
        }
200 186
      }
......
207 193
      
208 194
      synchronized(lock)
209 195
        {
210
        DistortedEffects q = mRenderer.getEffects();
211
        q.abortByType(EffectType.VERTEX);
212
        q.abortByType(EffectType.FRAGMENT);
213
        q.apply(mEffectSwirl);
196
        mRenderer.apply(mEffectSwirl);
214 197
        mCurrEffect = EFFECT_SWIRL;
215 198
        }
216 199
      }
......
221 204
      {
222 205
      synchronized(lock)
223 206
        {
224
        DistortedEffects q = mRenderer.getEffects();
225
        q.abortByType(EffectType.VERTEX);
226
        q.abortByType(EffectType.FRAGMENT);
207
        mRenderer.apply(null);
227 208
        mCenter.removeAll();
228 209
        mCurrEffect = EFFECT_POINTS;
229 210
        mRenderer.setRefresh();

Also available in: Unified diff