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/starwars/StarWarsSurfaceView.java
19 19

  
20 20
package org.distorted.examples.starwars;
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 StarWarsSurfaceView(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
    mRenderer = new StarWarsRenderer(this);
40 35
    setRenderer(mRenderer);
41 36
    }

Also available in: Unified diff