Project

General

Profile

« Previous | Next » 

Revision 392e16fd

Added by Leszek Koltunski over 7 years ago

Change in the API: we always have to create a DistortedFramebuffer to render to.

View differences:

src/main/java/org/distorted/examples/matrix3d/Matrix3DRenderer.java
24 24

  
25 25
import org.distorted.library.Distorted;
26 26
import org.distorted.library.DistortedEffectQueues;
27
import org.distorted.library.DistortedFramebuffer;
27 28
import org.distorted.library.GridObject;
28 29
import org.distorted.library.DistortedTexture;
29
import org.distorted.library.EffectTypes;
30 30

  
31 31
import javax.microedition.khronos.egl.EGLConfig;
32 32
import javax.microedition.khronos.opengles.GL10;
......
37 37
{
38 38
    private GLSurfaceView mView;
39 39
    private DistortedTexture mTexture;
40
    private DistortedEffectQueues mQueues;
40
    private DistortedEffectQueues mEffects;
41
    private DistortedFramebuffer mScreen;
41 42
    private GridObject mGrid;
42 43

  
43 44
    private int mWidth, mHeight;
......
50 51

  
51 52
      Matrix3DActivity act = (Matrix3DActivity)v.getContext();
52 53

  
53
      mQueues = act.getQueues();
54
      mEffects = act.getQueues();
54 55
      mTexture= act.getTexture();
55 56
      mGrid   = act.getGrid();
57
      mScreen = new DistortedFramebuffer(0);
56 58
      }
57 59

  
58 60
///////////////////////////////////////////////////////////////////////////////////////////////////
......
60 62
    public void onDrawFrame(GL10 glUnused)
61 63
      {
62 64
      GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
63
      mQueues.draw(System.currentTimeMillis(),mTexture,mGrid);
65
      mEffects.draw(System.currentTimeMillis(),mTexture,mGrid,mScreen);
64 66
      }
65 67

  
66 68
///////////////////////////////////////////////////////////////////////////////////////////////////
......
84 86
      mWidth = width;
85 87
      mHeight= height;
86 88

  
87
      Distorted.onSurfaceChanged(width, height);
89
      mScreen.resize(width, height);
88 90
      }
89 91

  
90 92
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff