Revision fe59d375
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/blur/BlurRenderer.java | ||
---|---|---|
27 | 27 |
import org.distorted.examples.R; |
28 | 28 |
import org.distorted.library.Distorted; |
29 | 29 |
import org.distorted.library.DistortedEffects; |
30 |
import org.distorted.library.DistortedFramebuffer; |
|
31 | 30 |
import org.distorted.library.DistortedScreen; |
32 | 31 |
import org.distorted.library.DistortedTexture; |
33 | 32 |
import org.distorted.library.EffectTypes; |
... | ... | |
47 | 46 |
class BlurRenderer implements GLSurfaceView.Renderer |
48 | 47 |
{ |
49 | 48 |
private GLSurfaceView mView; |
50 |
private DistortedTexture mTexture; |
|
51 | 49 |
private DistortedEffects mEffects; |
52 | 50 |
private DistortedScreen mScreen; |
53 | 51 |
private MeshFlat mMesh; |
... | ... | |
84 | 82 |
public void onDrawFrame(GL10 glUnused) |
85 | 83 |
{ |
86 | 84 |
GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT); |
87 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
85 |
mScreen.render( System.currentTimeMillis() );
|
|
88 | 86 |
} |
89 | 87 |
|
90 | 88 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
138 | 136 |
bmpHeight = bitmap.getHeight(); |
139 | 137 |
bmpWidth = bitmap.getWidth(); |
140 | 138 |
|
141 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
|
142 |
mTexture.setTexture(bitmap); |
|
139 |
DistortedTexture texture = new DistortedTexture(bmpWidth,bmpHeight); |
|
140 |
texture.setTexture(bitmap); |
|
141 |
|
|
142 |
mScreen.detachAll(); |
|
143 |
mScreen.attach(texture,mEffects,mMesh); |
|
143 | 144 |
|
144 | 145 |
try |
145 | 146 |
{ |
... | ... | |
147 | 148 |
} |
148 | 149 |
catch(Exception ex) |
149 | 150 |
{ |
150 |
android.util.Log.e("Renderer", ex.getMessage() );
|
|
151 |
android.util.Log.e("Blur", ex.getMessage() );
|
|
151 | 152 |
} |
152 | 153 |
} |
153 | 154 |
} |
Also available in: Unified diff
Change the the render() API!
THis introduces some regressions with the Effects3D app.