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/aroundtheworld/AroundTheWorldRenderer.java
21 21

  
22 22
import android.graphics.Bitmap;
23 23
import android.graphics.BitmapFactory;
24
import android.opengl.GLES30;
25 24
import android.opengl.GLSurfaceView;
26 25

  
27 26
import org.distorted.examples.R;
......
48 47
   private DistortedEffects mEffects;
49 48
   private DistortedTexture mTexture;
50 49
   private DistortedScreen mScreen;
50
   private MeshFlat mMesh;
51 51
   private AroundTheWorldEffectsManager mManager;
52 52
   private int mObjWidth, mObjHeight;
53 53

  
......
130 130
      if( mTexture==null ) mTexture = new DistortedTexture(mObjWidth,mObjHeight);
131 131
      mTexture.setTexture(bitmap);
132 132

  
133
      if( mMesh==null ) mMesh = new MeshFlat(30,30*mObjHeight/mObjWidth);
134

  
133 135
      mScreen.detachAll();
134
      mScreen.attach(mTexture, mEffects, new MeshFlat(30,30*mObjHeight/mObjWidth));
136
      mScreen.attach(mTexture, mEffects, mMesh);
135 137

  
136 138
      DistortedEffects.enableEffect(EffectNames.DISTORT);
137 139
      DistortedEffects.enableEffect(EffectNames.SINK);

Also available in: Unified diff