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/girl/GirlRenderer.java
28 28
import org.distorted.examples.R;
29 29

  
30 30
import org.distorted.library.Distorted;
31
import org.distorted.library.DistortedFramebuffer;
32 31
import org.distorted.library.DistortedScreen;
33 32
import org.distorted.library.MeshFlat;
34 33
import org.distorted.library.DistortedTexture;
......
50 49
class GirlRenderer implements GLSurfaceView.Renderer 
51 50
{
52 51
    private GLSurfaceView mView;
53
    private DistortedTexture mTexture;
54 52
    private DistortedEffects mEffects;
55 53
    private DistortedScreen mScreen;
56
    private MeshFlat mMesh;
57 54
    private Static3D v0,v1,v2,v3;
58 55
    private Static1D dBegin, dMiddle, dEnd, s0;
59 56
    private int bmpHeight, bmpWidth;
......
155 152
   public void onDrawFrame(GL10 glUnused) 
156 153
      {
157 154
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
158
      mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
155
      mScreen.render( System.currentTimeMillis() );
159 156
      }
160 157

  
161 158
///////////////////////////////////////////////////////////////////////////////////////////////////
......
209 206
      bmpHeight = bitmap.getHeight();
210 207
      bmpWidth  = bitmap.getWidth();
211 208

  
212
      mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
213
      mTexture = new DistortedTexture(bmpWidth,bmpHeight);
214
      mTexture.setTexture(bitmap);
209
      MeshFlat mesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
210
      DistortedTexture texture = new DistortedTexture(bmpWidth,bmpHeight);
211
      texture.setTexture(bitmap);
212

  
213
      mScreen.detachAll();
214
      mScreen.attach(texture,mEffects,mesh);
215 215

  
216 216
      try
217 217
        {

Also available in: Unified diff