Revision e8b6aa95
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/girl/GirlRenderer.java | ||
---|---|---|
28 | 28 |
import org.distorted.examples.R; |
29 | 29 |
|
30 | 30 |
import org.distorted.library.Distorted; |
31 |
import org.distorted.library.DistortedBitmap; |
|
31 |
import org.distorted.library.DistortedBitmapGrid; |
|
32 |
import org.distorted.library.DistortedObject; |
|
32 | 33 |
import org.distorted.library.EffectTypes; |
33 | 34 |
import org.distorted.library.type.Dynamic1D; |
34 | 35 |
import org.distorted.library.type.Dynamic3D; |
35 | 36 |
import org.distorted.library.type.Static1D; |
36 |
import org.distorted.library.type.Static2D; |
|
37 | 37 |
import org.distorted.library.type.Static3D; |
38 | 38 |
import org.distorted.library.type.Static4D; |
39 | 39 |
|
... | ... | |
47 | 47 |
class GirlRenderer implements GLSurfaceView.Renderer |
48 | 48 |
{ |
49 | 49 |
private GLSurfaceView mView; |
50 |
private DistortedBitmap mGirl; |
|
50 |
private DistortedObject mGirl; |
|
51 |
private DistortedBitmapGrid mGrid; |
|
51 | 52 |
private Static3D pLeft, pRight, pHips; |
52 | 53 |
private Static4D Region, sinkRegion, HipsRegion; |
53 | 54 |
private Dynamic3D diL, diR; |
... | ... | |
152 | 153 |
public void onDrawFrame(GL10 glUnused) |
153 | 154 |
{ |
154 | 155 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
155 |
mGirl.draw(System.currentTimeMillis()); |
|
156 |
mGirl.draw(System.currentTimeMillis(),mGrid);
|
|
156 | 157 |
} |
157 | 158 |
|
158 | 159 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
205 | 206 |
|
206 | 207 |
bmpHeight = bitmap.getHeight(); |
207 | 208 |
bmpWidth = bitmap.getWidth(); |
208 |
|
|
209 |
mGirl = new DistortedBitmap(bitmap, 30); |
|
209 |
|
|
210 |
mGrid = new DistortedBitmapGrid(30,30*bmpHeight/bmpWidth); |
|
211 |
mGirl = new DistortedObject(bmpWidth,bmpHeight,1); |
|
212 |
mGirl.setTexture(bitmap); |
|
210 | 213 |
|
211 | 214 |
mGirl.sink( diSink, pLeft, sinkRegion ); |
212 | 215 |
mGirl.sink( diSink, pRight,sinkRegion ); |
Also available in: Unified diff
Major change in API: separate the GRID from DistortedObject; completely remove classes derived from DistortedObject.