Revision 5f2a53b6
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java | ||
---|---|---|
53 | 53 |
private GLSurfaceView mView; |
54 | 54 |
private DistortedEffects[] mEffects; |
55 | 55 |
private DistortedTexture mTexture; |
56 |
private MeshFlat mMesh; |
|
56 | 57 |
private DistortedScreen mScreen; |
57 | 58 |
private int bmpHeight, bmpWidth; |
58 | 59 |
|
... | ... | |
162 | 163 |
bmpHeight = bitmap.getHeight(); |
163 | 164 |
bmpWidth = bitmap.getWidth(); |
164 | 165 |
|
165 |
MeshFlat mesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
|
|
166 |
if( mMesh==null ) mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
|
|
166 | 167 |
if( mTexture==null ) mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
167 | 168 |
mTexture.setTexture(bitmap); |
168 | 169 |
|
169 | 170 |
mScreen.detachAll(); |
170 |
for(int i=NUM-1; i>=0; i--) mScreen.attach(mTexture, mEffects[i], mesh); |
|
171 |
for(int i=NUM-1; i>=0; i--) mScreen.attach(mTexture, mEffects[i], mMesh);
|
|
171 | 172 |
|
172 | 173 |
DistortedEffects.enableEffect(EffectNames.SINK); |
173 | 174 |
DistortedEffects.enableEffect(EffectNames.DISTORT); |
Also available in: Unified diff
Progress with VBOs - this time abstract out a new class, DistortedObject - i.e. everything that uploads something to GPU and thus needs to be auto re-created upon loss of the context.