Revision 41a81a14
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java | ||
---|---|---|
41 | 41 |
|
42 | 42 |
import android.graphics.Bitmap; |
43 | 43 |
import android.graphics.BitmapFactory; |
44 |
import android.opengl.GLES20;
|
|
44 |
import android.opengl.GLES30;
|
|
45 | 45 |
import android.opengl.GLSurfaceView; |
46 | 46 |
|
47 | 47 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
101 | 101 |
|
102 | 102 |
public void onDrawFrame(GL10 glUnused) |
103 | 103 |
{ |
104 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
|
|
104 |
GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
|
|
105 | 105 |
|
106 | 106 |
long time = System.currentTimeMillis(); |
107 | 107 |
|
... | ... | |
148 | 148 |
|
149 | 149 |
public void onSurfaceCreated(GL10 glUnused, EGLConfig config) |
150 | 150 |
{ |
151 |
GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
|
151 |
GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
|
152 | 152 |
|
153 | 153 |
InputStream is = mView.getContext().getResources().openRawResource(R.raw.dog); |
154 | 154 |
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!)