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/earth/EarthRenderer.java
103 103

  
104 104
      mLevel = SCALE;
105 105

  
106
      DistortedEffects.setMax(EffectType.VERTEX  , MAX_EFF);
107
      DistortedEffects.setMax(EffectType.FRAGMENT, MAX_EFF);
108

  
109 106
      mStrength   = new Static1D(0.5f);
110 107
      mColor      = new Static3D(255,0,0);
111 108
      mRegionF    = new Static3D(RADIUS_F,RADIUS_F,RADIUS_F);
......
278 275
      Effect.enableEffects(EffectType.FRAGMENT);
279 276
      Effect.enableEffects(EffectType.VERTEX);
280 277

  
278
      DistortedEffects.setMax(EffectType.VERTEX  , MAX_EFF);
279
      DistortedEffects.setMax(EffectType.FRAGMENT, MAX_EFF);
280

  
281 281
      try
282 282
        {
283 283
        Distorted.onCreate(mView.getContext());

Also available in: Unified diff