Revision e8b6aa95
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/aroundtheworld/AroundTheWorldRenderer.java | ||
---|---|---|
26 | 26 |
|
27 | 27 |
import org.distorted.examples.R; |
28 | 28 |
import org.distorted.library.Distorted; |
29 |
import org.distorted.library.DistortedBitmap; |
|
29 |
import org.distorted.library.DistortedBitmapGrid;
|
|
30 | 30 |
import org.distorted.library.DistortedObject; |
31 | 31 |
import org.distorted.library.EffectTypes; |
32 | 32 |
import org.distorted.library.type.Static3D; |
... | ... | |
43 | 43 |
{ |
44 | 44 |
private GLSurfaceView mView; |
45 | 45 |
private DistortedObject mObject; |
46 |
private DistortedBitmapGrid mGrid; |
|
46 | 47 |
private AroundTheWorldEffectsManager mEffects; |
47 | 48 |
private int mObjWidth, mObjHeight; |
48 | 49 |
|
... | ... | |
69 | 70 |
public void onDrawFrame(GL10 glUnused) |
70 | 71 |
{ |
71 | 72 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
72 |
mObject.draw(System.currentTimeMillis()); |
|
73 |
mObject.draw(System.currentTimeMillis(), mGrid);
|
|
73 | 74 |
} |
74 | 75 |
|
75 | 76 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
118 | 119 |
catch(IOException e) { } |
119 | 120 |
} |
120 | 121 |
|
121 |
mObject = new DistortedBitmap(bitmap.getWidth(),bitmap.getHeight(),30); |
|
122 | 122 |
|
123 | 123 |
mObjWidth = mObject.getWidth(); |
124 | 124 |
mObjHeight= mObject.getHeight(); |
125 | 125 |
|
126 |
mObject.setBitmap(bitmap); |
|
126 |
mObject = new DistortedObject(mObjWidth,mObjHeight,1); |
|
127 |
mObject.setTexture(bitmap); |
|
127 | 128 |
mEffects.apply(mObject); |
128 | 129 |
|
130 |
mGrid = new DistortedBitmapGrid(30,30*mObjHeight/mObjWidth); |
|
131 |
|
|
129 | 132 |
try |
130 | 133 |
{ |
131 | 134 |
Distorted.onSurfaceCreated(mView.getContext()); |
Also available in: Unified diff
Major change in API: separate the GRID from DistortedObject; completely remove classes derived from DistortedObject.