Revision bc29e409
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/save/SaveRenderer.java | ||
---|---|---|
53 | 53 |
class SaveRenderer implements GLSurfaceView.Renderer |
54 | 54 |
{ |
55 | 55 |
private GLSurfaceView mView; |
56 |
private DistortedTexture mGirl;
|
|
56 |
private DistortedTexture mTexture;
|
|
57 | 57 |
private DistortedEffects mEffects; |
58 | 58 |
private GridFlat mGrid; |
59 | 59 |
private DistortedFramebuffer mScreen, mOffscreen; |
... | ... | |
156 | 156 |
{ |
157 | 157 |
mEffects.abortEffects(EffectTypes.MATRIX); |
158 | 158 |
mEffects.scale(mScaleFactor); |
159 |
mEffects.draw(time, mGirl, mGrid, mOffscreen);
|
|
159 |
mOffscreen.renderTo(mTexture, mGrid, mEffects, time );
|
|
160 | 160 |
applyMatrixEffects(scrWidth,scrHeight); |
161 | 161 |
|
162 | 162 |
int fW =(int)(mScale*bmpWidth); |
... | ... | |
180 | 180 |
isSaving = false; |
181 | 181 |
} |
182 | 182 |
|
183 |
mEffects.draw(time, mGirl, mGrid, mScreen);
|
|
183 |
mScreen.renderTo(mTexture, mGrid, mEffects, time );
|
|
184 | 184 |
} |
185 | 185 |
|
186 | 186 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
245 | 245 |
bmpWidth = bitmap.getWidth(); |
246 | 246 |
|
247 | 247 |
mGrid = new GridFlat(30,30*bmpHeight/bmpWidth); |
248 |
mGirl = new DistortedTexture(bmpWidth,bmpHeight);
|
|
249 |
mGirl.setTexture(bitmap);
|
|
248 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight);
|
|
249 |
mTexture.setTexture(bitmap);
|
|
250 | 250 |
|
251 | 251 |
mOffscreen = new DistortedFramebuffer( (int)(mScale*bmpWidth) , (int)(mScale*bmpHeight) ); |
252 | 252 |
|
Also available in: Unified diff
Again change of API. Now instead of the 'DistortedEffects.draw() and DistortedTree.draw()' we have 'DistortedFramebuffer.renderTo()'