Revision 40eef4b9
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/dynamic/DynamicRenderer.java | ||
---|---|---|
30 | 30 |
import android.opengl.GLSurfaceView; |
31 | 31 |
|
32 | 32 |
import org.distorted.library.GridFlat; |
33 |
import org.distorted.library.DistortedObject; |
|
33 |
import org.distorted.library.DistortedEffectQueues; |
|
34 |
import org.distorted.library.DistortedTexture; |
|
34 | 35 |
import org.distorted.library.Distorted; |
35 | 36 |
|
36 | 37 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
38 | 39 |
class DynamicRenderer implements GLSurfaceView.Renderer |
39 | 40 |
{ |
40 | 41 |
private DynamicSurfaceView mView; |
41 |
private DistortedObject mBackground; |
|
42 |
private DistortedTexture mTexture; |
|
43 |
private DistortedEffectQueues mQueues; |
|
42 | 44 |
private GridFlat mGrid; |
43 | 45 |
private Canvas mCanvas; |
44 | 46 |
private Bitmap mBitmap; |
... | ... | |
57 | 59 |
mPaint.setStyle(Style.FILL); |
58 | 60 |
|
59 | 61 |
mView = v; |
62 |
mGrid = new GridFlat(1,1); |
|
63 |
mQueues = new DistortedEffectQueues(); |
|
60 | 64 |
} |
61 | 65 |
|
62 | 66 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
80 | 84 |
texW = width; |
81 | 85 |
texH = height; |
82 | 86 |
|
83 |
mGrid = new GridFlat(1,1); |
|
84 |
mBackground = new DistortedObject(texW,texH,1); |
|
85 |
mBitmap = Bitmap.createBitmap(texW,texH, Bitmap.Config.ARGB_8888); |
|
86 |
mCanvas = new Canvas(mBitmap); |
|
87 |
mTexture= new DistortedTexture(texW,texH,0); |
|
88 |
mBitmap = Bitmap.createBitmap(texW,texH, Bitmap.Config.ARGB_8888); |
|
89 |
mCanvas = new Canvas(mBitmap); |
|
87 | 90 |
|
88 | 91 |
Distorted.onSurfaceChanged(texW,texH); |
89 | 92 |
mView.onSurfaceChanged(texW,texH); |
... | ... | |
99 | 102 |
|
100 | 103 |
mCanvas.drawRect(0, 0, texW, texH, mPaint); |
101 | 104 |
mView.drawCurve(mCanvas,time); |
102 |
mBackground.setTexture(mBitmap);
|
|
103 |
mBackground.draw(time,mGrid);
|
|
105 |
mTexture.setTexture(mBitmap);
|
|
106 |
mQueues.draw(time,mTexture,mGrid);
|
|
104 | 107 |
} |
105 | 108 |
|
106 | 109 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Beginnings of split of DistortedObject into two separate classes: DistortedEffectQueues and DistortedTexture.
Still does not compile, but pushing already.