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/dynamic/DynamicSurfaceView.java
19 19

  
20 20
package org.distorted.examples.dynamic;
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
import android.view.MotionEvent;
27 25
import android.util.AttributeSet;
......
110 108
        {
111 109
        setFocusable(true);
112 110
        setFocusableInTouchMode(true);
113
        final ActivityManager activityManager     = (android.app.ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
114
        final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
115
        setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 );
116 111
        DynamicRenderer mRenderer = new DynamicRenderer(this);
117 112
        setRenderer(mRenderer);
118 113
        }

Also available in: Unified diff