Revision e8b6aa95
Added by Leszek Koltunski about 9 years ago
| src/main/java/org/distorted/examples/wind/WindRenderer.java | ||
|---|---|---|
| 26 | 26 |
|
| 27 | 27 |
import org.distorted.examples.R; |
| 28 | 28 |
import org.distorted.library.Distorted; |
| 29 |
import org.distorted.library.DistortedCubes; |
|
| 29 |
import org.distorted.library.DistortedCubesGrid;
|
|
| 30 | 30 |
import org.distorted.library.DistortedObject; |
| 31 |
import org.distorted.library.EffectTypes; |
|
| 32 | 31 |
import org.distorted.library.type.Static1D; |
| 33 | 32 |
import org.distorted.library.type.Static3D; |
| 34 | 33 |
|
| ... | ... | |
| 44 | 43 |
{
|
| 45 | 44 |
private GLSurfaceView mView; |
| 46 | 45 |
private DistortedObject mObject; |
| 46 |
private DistortedCubesGrid mGrid; |
|
| 47 | 47 |
private WindEffectsManager mEffects; |
| 48 | 48 |
private int mObjWidth, mObjHeight; |
| 49 | 49 |
private int mWind; |
| ... | ... | |
| 54 | 54 |
{
|
| 55 | 55 |
mView = view; |
| 56 | 56 |
|
| 57 |
mObject = new DistortedCubes(50,30,10,false); |
|
| 57 |
mGrid = new DistortedCubesGrid(50,30,false); |
|
| 58 |
mObject = new DistortedObject(50,30,1); |
|
| 58 | 59 |
mEffects = new WindEffectsManager(mObject); |
| 59 | 60 |
|
| 60 | 61 |
mObjWidth = mObject.getWidth(); |
| ... | ... | |
| 74 | 75 |
public void onDrawFrame(GL10 glUnused) |
| 75 | 76 |
{
|
| 76 | 77 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 77 |
mObject.draw(System.currentTimeMillis()); |
|
| 78 |
mObject.draw(System.currentTimeMillis(),mGrid);
|
|
| 78 | 79 |
} |
| 79 | 80 |
|
| 80 | 81 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 121 | 122 |
catch(IOException e) { }
|
| 122 | 123 |
} |
| 123 | 124 |
|
| 124 |
mObject.setBitmap(bitmap);
|
|
| 125 |
mObject.setTexture(bitmap);
|
|
| 125 | 126 |
|
| 126 | 127 |
try |
| 127 | 128 |
{
|
Also available in: Unified diff
Major change in API: separate the GRID from DistortedObject; completely remove classes derived from DistortedObject.