Revision 41a81a14
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/listener/ListenerRenderer.java | ||
---|---|---|
43 | 43 |
|
44 | 44 |
import android.graphics.Bitmap; |
45 | 45 |
import android.graphics.BitmapFactory; |
46 |
import android.opengl.GLES20;
|
|
46 |
import android.opengl.GLES30;
|
|
47 | 47 |
import android.opengl.GLSurfaceView; |
48 | 48 |
|
49 | 49 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
105 | 105 |
|
106 | 106 |
public void onDrawFrame(GL10 glUnused) |
107 | 107 |
{ |
108 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
|
|
108 |
GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
|
|
109 | 109 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() ); |
110 | 110 |
} |
111 | 111 |
|
... | ... | |
139 | 139 |
|
140 | 140 |
public void onSurfaceCreated(GL10 glUnused, EGLConfig config) |
141 | 141 |
{ |
142 |
GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
|
142 |
GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
|
143 | 143 |
|
144 | 144 |
InputStream is = mView.getContext().getResources().openRawResource(R.raw.water); |
145 | 145 |
Bitmap bitmap; |
Also available in: Unified diff
Try using OpenGL ES 3.0 everywhere (but if device does not support it, try creating 2.0 context - this is important because of the emulator!)