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/listener/ListenerRenderer.java
55 55
   private DistortedEffects mEffects;
56 56
   private DistortedScreen mScreen;
57 57
   private DistortedTexture mTexture;
58
   private MeshFlat mMesh;
58 59
   private int bmpHeight, bmpWidth;
59 60
   private Random mRnd;
60 61

  
......
158 159
      if( mTexture==null ) mTexture = new DistortedTexture(bmpWidth,bmpHeight);
159 160
      mTexture.setTexture(bitmap);
160 161

  
162
      if( mMesh==null ) mMesh = new MeshFlat(50,50*bmpHeight/bmpWidth);
163

  
161 164
      mScreen.detachAll();
162
      mScreen.attach(mTexture,mEffects,new MeshFlat(50,50*bmpHeight/bmpWidth));
165
      mScreen.attach(mTexture,mEffects,mMesh);
163 166

  
164 167
      for(int i=0; i<NUM_BUBBLES; i++) randomizeNewBubble();
165 168

  

Also available in: Unified diff