Revision fe59d375
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/sink/SinkRenderer.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import org.distorted.library.Distorted; |
31 | 31 |
import org.distorted.library.DistortedEffects; |
32 |
import org.distorted.library.DistortedFramebuffer; |
|
33 | 32 |
import org.distorted.library.DistortedScreen; |
34 | 33 |
import org.distorted.library.MeshFlat; |
35 | 34 |
import org.distorted.library.DistortedTexture; |
... | ... | |
48 | 47 |
class SinkRenderer implements GLSurfaceView.Renderer |
49 | 48 |
{ |
50 | 49 |
private GLSurfaceView mView; |
51 |
private DistortedTexture mTexture; |
|
52 | 50 |
private DistortedEffects mEffects; |
53 | 51 |
private DistortedScreen mScreen; |
54 |
private MeshFlat mMesh; |
|
55 | 52 |
private int bmpHeight, bmpWidth; |
56 | 53 |
|
57 | 54 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
75 | 72 |
public void onDrawFrame(GL10 glUnused) |
76 | 73 |
{ |
77 | 74 |
GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT); |
78 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
75 |
mScreen.render( System.currentTimeMillis() );
|
|
79 | 76 |
} |
80 | 77 |
|
81 | 78 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
129 | 126 |
bmpHeight = bitmap.getHeight(); |
130 | 127 |
bmpWidth = bitmap.getWidth(); |
131 | 128 |
|
132 |
mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth); |
|
133 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
|
134 |
mTexture.setTexture(bitmap); |
|
129 |
MeshFlat mesh = new MeshFlat(30,30*bmpHeight/bmpWidth); |
|
130 |
DistortedTexture texture = new DistortedTexture(bmpWidth,bmpHeight); |
|
131 |
texture.setTexture(bitmap); |
|
132 |
|
|
133 |
mScreen.detachAll(); |
|
134 |
mScreen.attach(texture,mEffects,mesh); |
|
135 | 135 |
|
136 | 136 |
try |
137 | 137 |
{ |
Also available in: Unified diff
Change the the render() API!
THis introduces some regressions with the Effects3D app.