Project

General

Profile

« Previous | Next » 

Revision 676c14da

Added by Leszek Koltunski over 5 years ago

Relax requirements on when we can call DistortedEffects.setMax().

Before this change one had to call it before creation of shaders and before any of the DistortedEffects classes got created.
This commit removes the second requirement so now with setMax it's just like with enabling effects: it's best done in onSurfaceCreated.

View differences:

src/main/java/org/distorted/examples/listener/ListenerRenderer.java
66 66

  
67 67
   ListenerRenderer(GLSurfaceView v)
68 68
      {
69
      // one more than we have bubbles at any given time because it can sometimes happen that
70
      // the old bubble is not yet removed when we add a new one
71
      DistortedEffects.setMax(EffectType.VERTEX,NUM_BUBBLES+1);
72

  
73 69
      mView = v;
74 70
      mEffects = new DistortedEffects();
75 71
      mEffects.registerForMessages(this);
......
178 174

  
179 175
     for(int i=0; i<NUM_BUBBLES; i++) addNewBubble();
180 176

  
177
     // one more than we have bubbles at any given time because it can sometimes
178
     // happen that the old bubble is not yet removed when we add a new one
179
     DistortedEffects.setMax(EffectType.VERTEX,NUM_BUBBLES+1);
181 180
     VertexEffectDistort.enable();
182 181

  
183 182
     try

Also available in: Unified diff