Project

General

Profile

« Previous | Next » 

Revision 41a81a14

Added by Leszek Koltunski over 7 years ago

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!)

View differences:

src/main/java/org/distorted/examples/check/CheckRenderer.java
44 44
import android.content.DialogInterface;
45 45
import android.graphics.Bitmap;
46 46
import android.graphics.BitmapFactory;
47
import android.opengl.GLES20;
47
import android.opengl.GLES30;
48 48
import android.opengl.GLSurfaceView;
49 49
import android.util.Log;
50 50

  
......
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

  
......
115 115
    
116 116
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
117 117
      {  
118
      GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
118
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
119 119

  
120 120
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.success);
121 121
      Bitmap bitmap;
......
196 196
      
197 197
        String ver;
198 198
      
199
        ver = GLES20.glGetString(GLES20.GL_SHADING_LANGUAGE_VERSION);   
199
        ver = GLES30.glGetString(GLES30.GL_SHADING_LANGUAGE_VERSION);   
200 200
        compilationResult += "\n\nGLSL version: "+(ver==null ? "null" : ver);
201
        ver = GLES20.glGetString(GLES20.GL_VERSION);  
201
        ver = GLES30.glGetString(GLES30.GL_VERSION);  
202 202
        compilationResult += "\nGL version: "+(ver==null ? "null" : ver);
203
        ver = GLES20.glGetString(GLES20.GL_VENDOR);   
203
        ver = GLES30.glGetString(GLES30.GL_VENDOR);   
204 204
        compilationResult += "\nGL vendor: "+(ver==null ? "null" : ver);
205
        ver = GLES20.glGetString(GLES20.GL_RENDERER);    
205
        ver = GLES30.glGetString(GLES30.GL_RENDERER);    
206 206
        compilationResult += "\nGL renderer: "+(ver==null ? "null" : ver);
207 207
      
208 208
        CheckActivity act = (CheckActivity)mView.getContext();

Also available in: Unified diff