Project

General

Profile

« Previous | Next » 

Revision f6d884d5

Added by Leszek Koltunski over 7 years ago

Complete the split DistortedObject -> (DistortedTexture,DistortedEffectQueue)

View differences:

src/main/java/org/distorted/examples/matrix3d/Matrix3DRenderer.java
23 23
import android.opengl.GLSurfaceView;
24 24

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

  
30 31
import javax.microedition.khronos.egl.EGLConfig;
......
35 36
class Matrix3DRenderer implements GLSurfaceView.Renderer
36 37
{
37 38
    private GLSurfaceView mView;
38
    private DistortedObject mObject;
39
    private DistortedTexture mTexture;
40
    private DistortedEffectQueues mQueues;
39 41
    private GridObject mGrid;
40 42

  
41 43
    private int mWidth, mHeight;
......
48 50

  
49 51
      Matrix3DActivity act = (Matrix3DActivity)v.getContext();
50 52

  
51
      mObject= act.getObject();
52
      mGrid  = act.getGrid();
53
      mQueues = act.getQueues();
54
      mTexture= act.getTexture();
55
      mGrid   = act.getGrid();
53 56
      }
54 57

  
55 58
///////////////////////////////////////////////////////////////////////////////////////////////////
......
57 60
    public void onDrawFrame(GL10 glUnused)
58 61
      {
59 62
      GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
60

  
61
      long time = System.currentTimeMillis();
62

  
63
      mObject.draw(time,mGrid);
63
      mQueues.draw(System.currentTimeMillis(),mTexture,mGrid);
64 64
      }
65 65

  
66 66
///////////////////////////////////////////////////////////////////////////////////////////////////
......
81 81

  
82 82
    public void onSurfaceChanged(GL10 glUnused, int width, int height)
83 83
      {
84
      mObject.abortEffects(EffectTypes.MATRIX);
84
      mQueues.abortEffects(EffectTypes.MATRIX);
85 85

  
86 86
      mWidth = width;
87 87
      mHeight= height;
......
97 97

  
98 98
      Matrix3DActivity act = (Matrix3DActivity)mView.getContext();
99 99

  
100
      mObject.setTexture(act.getBitmap());
100
      mTexture.setTexture(act.getBitmap());
101 101

  
102 102
      try
103 103
        {

Also available in: Unified diff