Project

General

Profile

« Previous | Next » 

Revision e4330c89

Added by Leszek Koltunski almost 7 years ago

Change of API: move setting the EGL context back to the APP.

View differences:

src/main/java/org/distorted/examples/projection/ProjectionSurfaceView.java
19 19

  
20 20
package org.distorted.examples.projection;
21 21

  
22
import android.app.ActivityManager;
22 23
import android.content.Context;
24
import android.content.pm.ConfigurationInfo;
23 25
import android.opengl.GLSurfaceView;
24 26
import android.util.AttributeSet;
25 27

  
......
38 40
      if(!isInEditMode())
39 41
        {
40 42
        mRenderer = new ProjectionRenderer(this);
43
        final ActivityManager activityManager     = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
44
        final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
45
        setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 );
41 46
        setRenderer(mRenderer);
42 47
        }
43 48
      }

Also available in: Unified diff