Revision 5f2a53b6
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/check/CheckRenderer.java | ||
---|---|---|
59 | 59 |
private GLSurfaceView mView; |
60 | 60 |
private DistortedEffects mEffects; |
61 | 61 |
private DistortedTexture mTexture; |
62 |
private MeshFlat mMesh; |
|
62 | 63 |
private DistortedScreen mScreen; |
63 | 64 |
private int bmpHeight, bmpWidth; |
64 | 65 |
|
... | ... | |
136 | 137 |
if( mTexture==null ) mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
137 | 138 |
mTexture.setTexture(bitmap); |
138 | 139 |
|
140 |
if( mMesh==null ) mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth); |
|
141 |
|
|
139 | 142 |
mScreen.detachAll(); |
140 |
mScreen.attach(mTexture,mEffects,new MeshFlat(30,30*bmpHeight/bmpWidth));
|
|
143 |
mScreen.attach(mTexture,mEffects,mMesh);
|
|
141 | 144 |
|
142 | 145 |
mEffects.abortEffects(EffectTypes.VERTEX); |
143 | 146 |
mEffects.abortEffects(EffectTypes.FRAGMENT); |
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.