Revision 5f2a53b6
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/bean/BeanRenderer.java | ||
---|---|---|
50 | 50 |
private DistortedEffects mEffects; |
51 | 51 |
private DistortedScreen mScreen; |
52 | 52 |
private DistortedTexture mTexture; |
53 |
private MeshFlat mMesh; |
|
53 | 54 |
private int bmpHeight, bmpWidth; |
54 | 55 |
|
55 | 56 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
149 | 150 |
|
150 | 151 |
if( mTexture==null ) mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
151 | 152 |
mTexture.setTexture(bitmap); |
152 |
|
|
153 |
if( mMesh==null ) mMesh = new MeshFlat(25,25*bmpHeight/bmpWidth); |
|
153 | 154 |
mScreen.detachAll(); |
154 |
mScreen.attach(mTexture,mEffects,new MeshFlat(25,25*bmpHeight/bmpWidth));
|
|
155 |
mScreen.attach(mTexture,mEffects,mMesh);
|
|
155 | 156 |
|
156 | 157 |
DistortedEffects.enableEffect(EffectNames.DISTORT); |
157 | 158 |
|
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.