Project

General

Profile

« Previous | Next » 

Revision fe59d375

Added by Leszek Koltunski about 7 years ago

Change the the render() API!

THis introduces some regressions with the Effects3D app.

View differences:

src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java
29 29

  
30 30
import org.distorted.library.Distorted;
31 31
import org.distorted.library.DistortedEffects;
32
import org.distorted.library.DistortedFramebuffer;
33 32
import org.distorted.library.DistortedScreen;
34 33
import org.distorted.library.MeshFlat;
35 34
import org.distorted.library.DistortedTexture;
......
53 52
   
54 53
   private GLSurfaceView mView;
55 54
   private DistortedEffects[] mEffects;
56
   private DistortedTexture mTexture;
57
   private MeshFlat mMesh;
58 55
   private DistortedScreen mScreen;
59 56
   private int bmpHeight, bmpWidth;
60 57
    
......
103 100
   public void onDrawFrame(GL10 glUnused)
104 101
     {
105 102
     GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
106
      
107
     long time = System.currentTimeMillis();
108
   
109
     for(int i=NUM-1; i>=0; i--) mScreen.renderTo(mTexture, mMesh, mEffects[i], time);
103
     mScreen.render( System.currentTimeMillis() );
110 104
     }
111 105

  
112 106
///////////////////////////////////////////////////////////////////////////////////////////////////
......
170 164
     bmpHeight = bitmap.getHeight();
171 165
     bmpWidth  = bitmap.getWidth();
172 166

  
173
     mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
174
     mTexture  = new DistortedTexture(bmpWidth,bmpHeight);
167
     MeshFlat mesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
168
     DistortedTexture texture  = new DistortedTexture(bmpWidth,bmpHeight);
169
     texture.setTexture(bitmap);
175 170

  
176
     mTexture.setTexture(bitmap);
171
     mScreen.detachAll();
172
     for(int i=NUM-1; i>=0; i--) mScreen.attach(texture, mEffects[i], mesh);
177 173

  
178 174
     try
179 175
       {

Also available in: Unified diff