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/stencil/StencilSurfaceView.java
19 19

  
20 20
package org.distorted.examples.stencil;
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 StencilSurfaceView(Context context)
34 32
      {
35 33
      super(context);
36
      final ActivityManager activityManager     = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
37
      final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
38
      setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 );
39
      setEGLConfigChooser(5,6,5,0,16,8);       // 16 bit depth, 8 bit STENCIL
40 34
      setRenderer(new StencilRenderer(this));
41 35
      }
42 36
}

Also available in: Unified diff