Revision 1f9a52f1
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsSurfaceView.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.examples.differentbitmaps; |
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 DifferentBitmapsSurfaceView(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 DifferentBitmapsRenderer(this)); |
40 | 35 |
} |
41 | 36 |
} |
Also available in: Unified diff
Simplify setting up DistortedScreen.