Project

General

Profile

« Previous | Next » 

Revision c7a31368

Added by Leszek Koltunski about 4 years ago

Further corrections for the first apps.

View differences:

src/main/java/org/distorted/examples/movingeffects/MovingEffectsRenderer.java
30 30

  
31 31
import org.distorted.library.effect.FragmentEffectAlpha;
32 32
import org.distorted.library.effect.FragmentEffectChroma;
33
import org.distorted.library.effect.MatrixEffectScale;
33 34
import org.distorted.library.effect.VertexEffectDeform;
34 35
import org.distorted.library.effect.VertexEffectSink;
35 36
import org.distorted.library.effect.VertexEffectSwirl;
......
38 39
import org.distorted.library.main.DistortedTexture;
39 40
import org.distorted.library.main.DistortedEffects;
40 41
import org.distorted.library.mesh.MeshRectangles;
42
import org.distorted.library.type.Static3D;
41 43

  
42 44
///////////////////////////////////////////////////////////////////////////////////////////////////
43 45

  
......
54 56
   private DistortedScreen mScreen;
55 57
   private MeshRectangles mMesh;
56 58
   private boolean mRefresh;
59
   private Static3D mScale;
57 60

  
58 61
///////////////////////////////////////////////////////////////////////////////////////////////////
59 62

  
......
67 70
     mView   = v;
68 71
     mEffects= new DistortedEffects();
69 72
     mScreen = new DistortedScreen();
73
     mTexture= new DistortedTexture();
70 74
     mRefresh= true;
75

  
76
     mScale = new Static3D(1,1,1);
77
     mEffects.apply( new MatrixEffectScale(mScale));
71 78
     }
72 79

  
73 80
///////////////////////////////////////////////////////////////////////////////////////////////////
......
136 143
     texW = width;
137 144
     texH = height;
138 145

  
139
     if( mTexture!=null ) mTexture.markForDeletion();
140
     mTexture = new DistortedTexture();
146
     mScale.set(width,height,width);
147

  
141 148
     mBitmap  = Bitmap.createBitmap(texW,texH, Bitmap.Config.ARGB_8888);
142 149
     mCanvas  = new Canvas(mBitmap);
143 150

  
144 151
     if( mMesh!=null ) mMesh.markForDeletion();
145 152
     mMesh = new MeshRectangles(80,80*texH/texW);
146
     mMesh.setStretch(texW,texH,0);
147 153

  
148 154
     mScreen.detachAll();
149 155
     mScreen.attach(mTexture,mEffects,mMesh);

Also available in: Unified diff