Revision fe59d375
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/save/SaveRenderer.java | ||
---|---|---|
54 | 54 |
class SaveRenderer implements GLSurfaceView.Renderer |
55 | 55 |
{ |
56 | 56 |
private GLSurfaceView mView; |
57 |
private DistortedTexture mTexture; |
|
58 | 57 |
private DistortedEffects mEffects; |
59 |
private MeshFlat mMesh; |
|
60 | 58 |
private DistortedFramebuffer mOffscreen; |
61 | 59 |
private DistortedScreen mScreen; |
62 | 60 |
private Static1D s0; |
... | ... | |
158 | 156 |
{ |
159 | 157 |
mEffects.abortEffects(EffectTypes.MATRIX); |
160 | 158 |
mEffects.scale(mScaleFactor); |
161 |
mOffscreen.renderTo(mTexture, mMesh, mEffects, time );
|
|
159 |
mOffscreen.render(time);
|
|
162 | 160 |
applyMatrixEffects(scrWidth,scrHeight); |
163 | 161 |
|
164 | 162 |
int fW =(int)(mScale*bmpWidth); |
... | ... | |
182 | 180 |
isSaving = false; |
183 | 181 |
} |
184 | 182 |
|
185 |
mScreen.renderTo(mTexture, mMesh, mEffects, time );
|
|
183 |
mScreen.render(time);
|
|
186 | 184 |
} |
187 | 185 |
|
188 | 186 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
246 | 244 |
bmpHeight = bitmap.getHeight(); |
247 | 245 |
bmpWidth = bitmap.getWidth(); |
248 | 246 |
|
249 |
mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
|
|
250 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight);
|
|
251 |
mTexture.setTexture(bitmap);
|
|
247 |
MeshFlat mesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
|
|
248 |
DistortedTexture texture = new DistortedTexture(bmpWidth,bmpHeight);
|
|
249 |
texture.setTexture(bitmap);
|
|
252 | 250 |
|
253 | 251 |
mOffscreen = new DistortedFramebuffer( (int)(mScale*bmpWidth) , (int)(mScale*bmpHeight) ); |
254 | 252 |
|
253 |
mOffscreen.detachAll(); |
|
254 |
mOffscreen.attach(texture,mEffects,mesh); |
|
255 |
mScreen.detachAll(); |
|
256 |
mScreen.attach(texture,mEffects,mesh); |
|
257 |
|
|
255 | 258 |
try |
256 | 259 |
{ |
257 | 260 |
Distorted.onCreate(mView.getContext()); |
Also available in: Unified diff
Change the the render() API!
THis introduces some regressions with the Effects3D app.