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/check/CheckRenderer.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.DistortedTexture;
35 34
import org.distorted.library.MeshFlat;
......
57 56
    private static String compilationTitle;
58 57

  
59 58
    private GLSurfaceView mView;
60
    private DistortedTexture mTexture;
61 59
    private DistortedEffects mEffects;
62
    private MeshFlat mMesh;
63 60
    private DistortedScreen mScreen;
64 61
    private int bmpHeight, bmpWidth;
65 62

  
......
83 80
    public void onDrawFrame(GL10 glUnused) 
84 81
      {
85 82
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
86
      mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
83
      mScreen.render( System.currentTimeMillis() );
87 84
      }
88 85

  
89 86
///////////////////////////////////////////////////////////////////////////////////////////////////
......
137 134
      bmpHeight = bitmap.getHeight();
138 135
      bmpWidth  = bitmap.getWidth();
139 136

  
140
      mTexture = new DistortedTexture(bmpWidth,bmpHeight);
141
      mTexture.setTexture(bitmap);
142
      mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
137
      DistortedTexture texture = new DistortedTexture(bmpWidth,bmpHeight);
138
      texture.setTexture(bitmap);
139
      MeshFlat mesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
140

  
141
      mScreen.detachAll();
142
      mScreen.attach(texture,mEffects,mesh);
143 143

  
144 144
      // Try adding 2 Vertex Effects to the Bitmap.
145 145
      // This will fail if we have set maxVertexEffects to something < 2.

Also available in: Unified diff