Revision fe59d375
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsRenderer.java | ||
---|---|---|
28 | 28 |
import org.distorted.examples.R; |
29 | 29 |
|
30 | 30 |
import org.distorted.library.Distorted; |
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.DistortedEffects; |
... | ... | |
51 | 50 |
private static final int NUM = 3; |
52 | 51 |
|
53 | 52 |
private GLSurfaceView mView; |
54 |
private DistortedTexture[] mTexture; |
|
55 | 53 |
private DistortedEffects[] mEffects; |
56 |
private MeshFlat mMesh; |
|
57 | 54 |
private DistortedScreen mScreen; |
58 | 55 |
private int bmpHeight, bmpWidth; |
59 | 56 |
|
... | ... | |
109 | 106 |
public void onDrawFrame(GL10 glUnused) |
110 | 107 |
{ |
111 | 108 |
GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT); |
112 |
|
|
113 |
long time = System.currentTimeMillis(); |
|
114 |
|
|
115 |
for(int i=NUM-1; i>=0; i--) mScreen.renderTo(mTexture[i], mMesh, mEffects[i], time); |
|
109 |
mScreen.render( System.currentTimeMillis() ); |
|
116 | 110 |
} |
117 | 111 |
|
118 | 112 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
164 | 158 |
bmpHeight = bitmap0.getHeight(); |
165 | 159 |
bmpWidth = bitmap0.getWidth(); |
166 | 160 |
|
167 |
mTexture = new DistortedTexture[NUM];
|
|
161 |
DistortedTexture[] texture = new DistortedTexture[NUM];
|
|
168 | 162 |
for(int i=0; i<NUM; i++) |
169 |
mTexture[i] = new DistortedTexture(bmpWidth,bmpHeight);
|
|
163 |
texture[i] = new DistortedTexture(bmpWidth,bmpHeight);
|
|
170 | 164 |
|
171 |
mTexture[0].setTexture(bitmap0); |
|
172 |
mTexture[1].setTexture(bitmap1); |
|
173 |
mTexture[2].setTexture(bitmap2); |
|
165 |
texture[0].setTexture(bitmap0); |
|
166 |
texture[1].setTexture(bitmap1); |
|
167 |
texture[2].setTexture(bitmap2); |
|
168 |
|
|
169 |
MeshFlat mesh = new MeshFlat(30,30*bmpHeight/bmpWidth); |
|
174 | 170 |
|
175 |
mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth); |
|
171 |
mScreen.detachAll(); |
|
172 |
for(int i=NUM-1; i>=0; i--) mScreen.attach(texture[i], mEffects[i], mesh); |
|
176 | 173 |
|
177 | 174 |
try |
178 | 175 |
{ |
Also available in: Unified diff
Change the the render() API!
THis introduces some regressions with the Effects3D app.