Revision fe59d375
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java | ||
---|---|---|
28 | 28 |
import org.distorted.examples.R; |
29 | 29 |
import org.distorted.library.Distorted; |
30 | 30 |
import org.distorted.library.DistortedEffects; |
31 |
import org.distorted.library.DistortedFramebuffer; |
|
32 | 31 |
import org.distorted.library.DistortedScreen; |
33 | 32 |
import org.distorted.library.DistortedTexture; |
34 | 33 |
import org.distorted.library.MeshFlat; |
... | ... | |
47 | 46 |
class MonaLisaRenderer 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 |
private MeshFlat mMesh; |
|
54 | 51 |
private int bmpHeight, bmpWidth; |
55 | 52 |
|
56 | 53 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
83 | 80 |
public void onDrawFrame(GL10 glUnused) |
84 | 81 |
{ |
85 | 82 |
GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT); |
86 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
83 |
mScreen.render( System.currentTimeMillis() );
|
|
87 | 84 |
} |
88 | 85 |
|
89 | 86 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
135 | 132 |
bmpHeight = bitmap.getHeight(); |
136 | 133 |
bmpWidth = bitmap.getWidth(); |
137 | 134 |
|
138 |
mMesh = new MeshFlat(9,9*bmpHeight/bmpWidth); |
|
139 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
|
140 |
mTexture.setTexture(bitmap); |
|
135 |
MeshFlat mesh = new MeshFlat(9,9*bmpHeight/bmpWidth); |
|
136 |
DistortedTexture texture = new DistortedTexture(bmpWidth,bmpHeight); |
|
137 |
texture.setTexture(bitmap); |
|
138 |
|
|
139 |
mScreen.detachAll(); |
|
140 |
mScreen.attach(texture,mEffects,mesh); |
|
141 | 141 |
|
142 | 142 |
try |
143 | 143 |
{ |
Also available in: Unified diff
Change the the render() API!
THis introduces some regressions with the Effects3D app.