Project

General

Profile

« Previous | Next » 

Revision 1f9a52f1

Added by Leszek Koltunski almost 7 years ago

Simplify setting up DistortedScreen.

View differences:

src/main/java/org/distorted/examples/bean/BeanSurfaceView.java
19 19

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

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

  
28 25
///////////////////////////////////////////////////////////////////////////////////////////////////
29 26

  
......
34 31
    public BeanSurfaceView(Context context) 
35 32
      {
36 33
      super(context);
37
      final ActivityManager activityManager     = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
38
      final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
39
      setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 );
40 34
      setRenderer(new BeanRenderer(this));
41 35
      }
42 36
}

Also available in: Unified diff