Revision 392e16fd
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.DistortedFramebuffer; |
|
32 | 33 |
import org.distorted.library.GridFlat; |
33 | 34 |
import org.distorted.library.DistortedEffectQueues; |
34 | 35 |
import org.distorted.library.DistortedTexture; |
... | ... | |
40 | 41 |
{ |
41 | 42 |
private DynamicSurfaceView mView; |
42 | 43 |
private DistortedTexture mTexture; |
43 |
private DistortedEffectQueues mQueues; |
|
44 |
private DistortedEffectQueues mEffects; |
|
45 |
private DistortedFramebuffer mScreen; |
|
44 | 46 |
private GridFlat mGrid; |
45 | 47 |
private Canvas mCanvas; |
46 | 48 |
private Bitmap mBitmap; |
... | ... | |
60 | 62 |
|
61 | 63 |
mView = v; |
62 | 64 |
mGrid = new GridFlat(1,1); |
63 |
mQueues = new DistortedEffectQueues(); |
|
65 |
mEffects = new DistortedEffectQueues(); |
|
66 |
mScreen = new DistortedFramebuffer(0); |
|
64 | 67 |
} |
65 | 68 |
|
66 | 69 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
88 | 91 |
mBitmap = Bitmap.createBitmap(texW,texH, Bitmap.Config.ARGB_8888); |
89 | 92 |
mCanvas = new Canvas(mBitmap); |
90 | 93 |
|
91 |
Distorted.onSurfaceChanged(texW,texH);
|
|
94 |
mScreen.resize(texW,texH);
|
|
92 | 95 |
mView.onSurfaceChanged(texW,texH); |
93 | 96 |
} |
94 | 97 |
|
... | ... | |
103 | 106 |
mCanvas.drawRect(0, 0, texW, texH, mPaint); |
104 | 107 |
mView.drawCurve(mCanvas,time); |
105 | 108 |
mTexture.setTexture(mBitmap); |
106 |
mQueues.draw(time,mTexture,mGrid);
|
|
109 |
mEffects.draw(time,mTexture,mGrid,mScreen);
|
|
107 | 110 |
} |
108 | 111 |
|
109 | 112 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Change in the API: we always have to create a DistortedFramebuffer to render to.