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/sink/SinkRenderer.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
///////////////////////////////////////////////////////////////////////////////////////////////////
......
126 127

  
127 128
    if( mTexture==null ) mTexture = new DistortedTexture(bmpWidth,bmpHeight);
128 129
    mTexture.setTexture(bitmap);
130
    if( mMesh==null ) mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
129 131

  
130 132
    mScreen.detachAll();
131
    mScreen.attach(mTexture,mEffects,new MeshFlat(30,30*bmpHeight/bmpWidth));
133
    mScreen.attach(mTexture,mEffects,mMesh);
132 134

  
133 135
    DistortedEffects.enableEffect(EffectNames.SINK);
134 136

  

Also available in: Unified diff