Revision 5f2a53b6
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/projection/ProjectionRenderer.java | ||
---|---|---|
44 | 44 |
private GLSurfaceView mView; |
45 | 45 |
private DistortedEffects mEffects; |
46 | 46 |
private DistortedScreen mScreen; |
47 |
private MeshFlat mMesh; |
|
47 | 48 |
private DistortedTexture mTexture; |
48 | 49 |
private float mF, mNear; |
49 | 50 |
|
... | ... | |
122 | 123 |
mTexture= new DistortedTexture(width,height); |
123 | 124 |
mTexture.setTexture(bmp); |
124 | 125 |
|
126 |
// likewise with the Mesh |
|
127 |
if( mMesh!=null ) mMesh.markForDeletion(); |
|
128 |
|
|
129 |
mMesh = new MeshFlat(50,50*height/width); |
|
130 |
|
|
125 | 131 |
mScreen.detachAll(); |
126 |
mScreen.attach(mTexture,mEffects,new MeshFlat(50,50*height/width));
|
|
132 |
mScreen.attach(mTexture,mEffects,mMesh);
|
|
127 | 133 |
mScreen.resize(width, height); |
128 | 134 |
} |
129 | 135 |
|
Also available in: Unified diff
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.