Revision 1f9a52f1
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/examples/effects3d/Effects3DSurfaceView.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.examples.effects3d; |
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.util.AttributeSet; |
27 | 25 |
import android.view.MotionEvent; |
... | ... | |
41 | 39 |
|
42 | 40 |
if(!isInEditMode()) |
43 | 41 |
{ |
44 |
final ActivityManager activityManager = (android.app.ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); |
|
45 |
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo(); |
|
46 |
setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 ); |
|
47 | 42 |
mRenderer = new Effects3DRenderer(this); |
48 | 43 |
setRenderer(mRenderer); |
49 | 44 |
} |
Also available in: Unified diff
Simplify setting up DistortedScreen.