Revision 41a81a14
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/cubes/CubesRenderer.java | ||
---|---|---|
39 | 39 |
|
40 | 40 |
import android.graphics.Bitmap; |
41 | 41 |
import android.graphics.BitmapFactory; |
42 |
import android.opengl.GLES20;
|
|
42 |
import android.opengl.GLES30;
|
|
43 | 43 |
import android.opengl.GLSurfaceView; |
44 | 44 |
|
45 | 45 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
88 | 88 |
|
89 | 89 |
public void onDrawFrame(GL10 glUnused) |
90 | 90 |
{ |
91 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
|
|
91 |
GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
|
|
92 | 92 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() ); |
93 | 93 |
} |
94 | 94 |
|
... | ... | |
124 | 124 |
|
125 | 125 |
public void onSurfaceCreated(GL10 glUnused, EGLConfig config) |
126 | 126 |
{ |
127 |
GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
|
127 |
GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
|
128 | 128 |
|
129 | 129 |
InputStream is = mView.getContext().getResources().openRawResource(R.raw.grid); |
130 | 130 |
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!)