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/fbo/FBORenderer.java
29 29

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

  
39 39
import android.graphics.Bitmap;
......
46 46
class FBORenderer implements GLSurfaceView.Renderer 
47 47
{
48 48
   private GLSurfaceView mView;
49
   private DistortedBitmap mLisa;
49
   private DistortedObject mLisa;
50 50
   private int lisaHeight, lisaWidth;
51 51
    
52 52
   private DistortedNode mRoot;
......
121 121
      lisaHeight = bitmap1.getHeight();
122 122
      lisaWidth  = bitmap1.getWidth();
123 123
      
124
      mLisa = new DistortedBitmap(bitmap1, 20);
125
      DistortedBitmap text = new DistortedBitmap(bitmap2, 20);
126
      
127
      mRoot = new DistortedNode(mLisa);
128
      mRoot.attach(text);
124
      mLisa = new DistortedObject(lisaWidth, lisaHeight, 1);
125
      mLisa.setTexture(bitmap1);
126
      DistortedObject text = new DistortedObject(bitmap2.getWidth(),bitmap2.getHeight(),1);
127
      text.setTexture(bitmap2);
128

  
129
      mRoot = new DistortedNode(mLisa,new DistortedBitmapGrid(1,1));
130
      mRoot.attach(text,new DistortedBitmapGrid(20,5));
129 131
     
130 132
      int textWidth  = text.getWidth();
131 133
      int textHeight = text.getHeight();
......
153 155
        }
154 156
      catch(Exception ex)
155 157
        {
156
        android.util.Log.e("MonaLisa", ex.getMessage() );
158
        android.util.Log.e("FBO", ex.getMessage() );
157 159
        }
158 160
      }
159 161
}

Also available in: Unified diff