Revision e7a4ef16
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/listener/ListenerRenderer.java | ||
---|---|---|
48 | 48 |
|
49 | 49 |
class ListenerRenderer implements GLSurfaceView.Renderer,EffectListener |
50 | 50 |
{ |
51 |
private final int NUM_BUBBLES = 12; |
|
52 |
|
|
51 | 53 |
private GLSurfaceView mView; |
52 | 54 |
private DistortedBitmap water; |
53 | 55 |
private int bmpHeight, bmpWidth; |
54 | 56 |
private Random mRnd; |
55 |
|
|
56 |
private final int NUM_BUBBLES = 12; |
|
57 |
|
|
57 |
|
|
58 | 58 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
59 | 59 |
|
60 |
public ListenerRenderer(GLSurfaceView v)
|
|
60 |
ListenerRenderer(GLSurfaceView v)
|
|
61 | 61 |
{ |
62 | 62 |
Distorted.setMaxVertex(NUM_BUBBLES); |
63 | 63 |
mView = v; |
... | ... | |
96 | 96 |
|
97 | 97 |
public void onDrawFrame(GL10 glUnused) |
98 | 98 |
{ |
99 |
GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); |
|
100 | 99 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
101 |
|
|
102 | 100 |
water.draw(System.currentTimeMillis()); |
103 | 101 |
} |
104 | 102 |
|
... | ... | |
132 | 130 |
|
133 | 131 |
public void onSurfaceCreated(GL10 glUnused, EGLConfig config) |
134 | 132 |
{ |
133 |
GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); |
|
134 |
|
|
135 | 135 |
InputStream is = mView.getContext().getResources().openRawResource(R.raw.water); |
136 | 136 |
Bitmap bitmap; |
137 | 137 |
|
Also available in: Unified diff
Minor stuff