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/movingeffects/MovingEffectsRenderer.java
48 48
   private DistortedEffects mEffects;
49 49
   private DistortedTexture mTexture;
50 50
   private DistortedScreen mScreen;
51
   private MeshFlat mMesh;
51 52
   private boolean mRefresh;
52 53

  
53 54
///////////////////////////////////////////////////////////////////////////////////////////////////
......
136 137
     mBitmap  = Bitmap.createBitmap(texW,texH, Bitmap.Config.ARGB_8888);
137 138
     mCanvas  = new Canvas(mBitmap);
138 139

  
140
     if( mMesh!=null ) mMesh.markForDeletion();
141
     mMesh = new MeshFlat(80,80*texH/texW);
142

  
139 143
     mScreen.detachAll();
140
     mScreen.attach(mTexture,mEffects,new MeshFlat(80,80*texH/texW));
144
     mScreen.attach(mTexture,mEffects,mMesh);
141 145
     mScreen.resize(texW, texH);
142 146
     mView.onSurfaceChanged(texW,texH);
143 147

  

Also available in: Unified diff