Project

General

Profile

« Previous | Next » 

Revision 5f2a53b6

Added by Leszek Koltunski about 7 years ago

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.

View differences:

src/main/java/org/distorted/examples/girl/GirlRenderer.java
52 52
    private DistortedEffects mEffects;
53 53
    private DistortedScreen mScreen;
54 54
    private DistortedTexture mTexture;
55
    private MeshFlat mMesh;
55 56
    private Static3D v0,v1,v2,v3;
56 57
    private Static1D dBegin, dMiddle, dEnd, s0;
57 58
    private int bmpHeight, bmpWidth;
......
207 208
      if( mTexture==null ) mTexture = new DistortedTexture(bmpWidth,bmpHeight);
208 209
      mTexture.setTexture(bitmap);
209 210

  
211
      if( mMesh==null ) mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
212

  
210 213
      mScreen.detachAll();
211
      mScreen.attach(mTexture,mEffects,new MeshFlat(30,30*bmpHeight/bmpWidth));
214
      mScreen.attach(mTexture,mEffects,mMesh);
212 215

  
213 216
      DistortedEffects.enableEffect(EffectNames.DISTORT);
214 217
      DistortedEffects.enableEffect(EffectNames.SINK);

Also available in: Unified diff