Revision 41a81a14
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java | ||
---|---|---|
38 | 38 |
|
39 | 39 |
import android.graphics.Bitmap; |
40 | 40 |
import android.graphics.BitmapFactory; |
41 |
import android.opengl.GLES20;
|
|
41 |
import android.opengl.GLES30;
|
|
42 | 42 |
import android.opengl.GLSurfaceView; |
43 | 43 |
|
44 | 44 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
81 | 81 |
|
82 | 82 |
public void onDrawFrame(GL10 glUnused) |
83 | 83 |
{ |
84 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
|
|
84 |
GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
|
|
85 | 85 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() ); |
86 | 86 |
} |
87 | 87 |
|
... | ... | |
113 | 113 |
|
114 | 114 |
public void onSurfaceCreated(GL10 glUnused, EGLConfig config) |
115 | 115 |
{ |
116 |
GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
|
116 |
GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
|
117 | 117 |
|
118 | 118 |
InputStream is = mView.getContext().getResources().openRawResource(R.raw.monalisa); |
119 | 119 |
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!)