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/save/SaveRenderer.java
31 31
import org.distorted.examples.R;
32 32

  
33 33
import org.distorted.library.Distorted;
34
import org.distorted.library.DistortedBitmap;
34
import org.distorted.library.DistortedObject;
35
import org.distorted.library.DistortedBitmapGrid;
35 36
import org.distorted.library.DistortedFramebuffer;
36 37
import org.distorted.library.EffectTypes;
37 38
import org.distorted.library.type.Dynamic1D;
......
51 52
class SaveRenderer implements GLSurfaceView.Renderer
52 53
  {
53 54
  private GLSurfaceView mView;
54
  private DistortedBitmap mGirl;
55
  private DistortedObject mGirl;
56
  private DistortedBitmapGrid mGrid;
55 57
  private DistortedFramebuffer mOffscreen;
56 58
  private Static3D pLeft, pRight;
57 59
  private Static4D sinkRegion;
......
147 149
      {
148 150
      mGirl.abortEffects(EffectTypes.MATRIX);
149 151
      mGirl.scale(mScaleFactor);
150
      mGirl.draw(System.currentTimeMillis(), mOffscreen);
152
      mGirl.draw(System.currentTimeMillis(), mGrid, mOffscreen);
151 153
      applyMatrixEffects(scrWidth,scrHeight);
152 154

  
153 155
      int fW =(int)(mScale*bmpWidth);
......
162 164
      isSaving = false;
163 165
      }
164 166

  
165
    mGirl.draw(System.currentTimeMillis());
167
    mGirl.draw(System.currentTimeMillis(), mGrid);
166 168
    }
167 169

  
168 170
///////////////////////////////////////////////////////////////////////////////////////////////////
......
225 227
      
226 228
    bmpHeight = bitmap.getHeight();
227 229
    bmpWidth  = bitmap.getWidth();
228
      
229
    mGirl = new DistortedBitmap(bitmap, 30);
230

  
231
    mGrid = new DistortedBitmapGrid(30,30*bmpHeight/bmpWidth);
232
    mGirl = new DistortedObject(bmpWidth,bmpHeight,1);
233
    mGirl.setTexture(bitmap);
230 234

  
231 235
    mGirl.sink( diSink, pLeft , sinkRegion);
232 236
    mGirl.sink( diSink, pRight, sinkRegion);

Also available in: Unified diff