Project

General

Profile

« Previous | Next » 

Revision e8b6aa95

Added by Leszek Koltunski over 7 years ago

Major change in API: separate the GRID from DistortedObject; completely remove classes derived from DistortedObject.

View differences:

src/main/java/org/distorted/examples/check/CheckRenderer.java
28 28
import org.distorted.examples.R;
29 29

  
30 30
import org.distorted.library.Distorted;
31
import org.distorted.library.DistortedBitmap;
31
import org.distorted.library.DistortedObject;
32
import org.distorted.library.DistortedBitmapGrid;
32 33
import org.distorted.library.EffectTypes;
33 34
import org.distorted.library.type.Dynamic3D;
34 35
import org.distorted.library.type.Static1D;
35
import org.distorted.library.type.Static2D;
36 36
import org.distorted.library.type.Static3D;
37 37
import org.distorted.library.type.Static4D;
38 38
import org.distorted.library.type.Dynamic1D;
39
import org.distorted.library.type.Dynamic2D;
40 39

  
41 40
import android.app.AlertDialog;
42 41
import android.content.Context;
......
55 54
    private static String compilationTitle;
56 55

  
57 56
    private GLSurfaceView mView;
58
    private DistortedBitmap mSuccess;
57
    private DistortedObject mSuccess;
58
    private DistortedBitmapGrid mGrid;
59 59
    private int bmpHeight, bmpWidth;
60 60

  
61 61
///////////////////////////////////////////////////////////////////////////////////////////////////
......
75 75
    public void onDrawFrame(GL10 glUnused) 
76 76
      {
77 77
      GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
78
      mSuccess.draw(System.currentTimeMillis());
78
      mSuccess.draw(System.currentTimeMillis(), mGrid);
79 79
      }
80 80

  
81 81
///////////////////////////////////////////////////////////////////////////////////////////////////
......
126 126
        catch(IOException e) { }
127 127
        }
128 128

  
129
      mSuccess = new DistortedBitmap(bitmap, 30);
130

  
131 129
      bmpHeight = bitmap.getHeight();
132 130
      bmpWidth  = bitmap.getWidth();
133 131

  
132
      mSuccess = new DistortedObject(bmpWidth,bmpHeight,1);
133
      mSuccess.setTexture(bitmap);
134
      mGrid = new DistortedBitmapGrid(30,30*bmpHeight/bmpWidth);
135

  
134 136
      // Try adding 2 Vertex Effects to the Bitmap.
135 137
      // This will fail if we have set maxVertexEffects to something < 2.
136 138
      //

Also available in: Unified diff