Project

General

Profile

« Previous | Next » 

Revision 1f9a52f1

Added by Leszek Koltunski about 7 years ago

Simplify setting up DistortedScreen.

View differences:

src/main/java/org/distorted/examples/catanddog/CatAndDogSurfaceView.java
19 19

  
20 20
package org.distorted.examples.catanddog;
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 24

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

Also available in: Unified diff