Revision e8b6aa95
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/dynamic/DynamicRenderer.java | ||
---|---|---|
29 | 29 |
import android.opengl.GLES20; |
30 | 30 |
import android.opengl.GLSurfaceView; |
31 | 31 |
|
32 |
import org.distorted.library.DistortedBitmap; |
|
32 |
import org.distorted.library.DistortedBitmapGrid; |
|
33 |
import org.distorted.library.DistortedObject; |
|
33 | 34 |
import org.distorted.library.Distorted; |
34 | 35 |
|
35 | 36 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
37 | 38 |
class DynamicRenderer implements GLSurfaceView.Renderer |
38 | 39 |
{ |
39 | 40 |
private DynamicSurfaceView mView; |
40 |
private DistortedBitmap mBackground; |
|
41 |
private DistortedObject mBackground; |
|
42 |
private DistortedBitmapGrid mGrid; |
|
41 | 43 |
private Canvas mCanvas; |
42 | 44 |
private Bitmap mBitmap; |
43 | 45 |
private Paint mPaint; |
... | ... | |
78 | 80 |
texW = width; |
79 | 81 |
texH = height; |
80 | 82 |
|
81 |
mBackground = new DistortedBitmap(texW,texH, 2); |
|
82 |
mBitmap = Bitmap.createBitmap(texW,texH, Bitmap.Config.ARGB_8888); |
|
83 |
mCanvas = new Canvas(mBitmap); |
|
83 |
mGrid = new DistortedBitmapGrid(1,1); |
|
84 |
mBackground = new DistortedObject(texW,texH,1); |
|
85 |
mBitmap = Bitmap.createBitmap(texW,texH, Bitmap.Config.ARGB_8888); |
|
86 |
mCanvas = new Canvas(mBitmap); |
|
84 | 87 |
|
85 | 88 |
Distorted.onSurfaceChanged(texW,texH); |
86 | 89 |
mView.onSurfaceChanged(texW,texH); |
... | ... | |
96 | 99 |
|
97 | 100 |
mCanvas.drawRect(0, 0, texW, texH, mPaint); |
98 | 101 |
mView.drawCurve(mCanvas,time); |
99 |
mBackground.setBitmap(mBitmap);
|
|
100 |
mBackground.draw(time); |
|
102 |
mBackground.setTexture(mBitmap);
|
|
103 |
mBackground.draw(time,mGrid);
|
|
101 | 104 |
} |
102 | 105 |
|
103 | 106 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Major change in API: separate the GRID from DistortedObject; completely remove classes derived from DistortedObject.