Revision e4330c89
Added by Leszek Koltunski almost 7 years ago
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; |
|
22 | 23 |
import android.content.Context; |
24 |
import android.content.pm.ConfigurationInfo; |
|
23 | 25 |
import android.opengl.GLSurfaceView; |
24 | 26 |
import android.view.MotionEvent; |
25 | 27 |
import android.util.AttributeSet; |
... | ... | |
109 | 111 |
setFocusable(true); |
110 | 112 |
setFocusableInTouchMode(true); |
111 | 113 |
DynamicRenderer mRenderer = new DynamicRenderer(this); |
114 |
final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); |
|
115 |
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo(); |
|
116 |
setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 ); |
|
112 | 117 |
setRenderer(mRenderer); |
113 | 118 |
} |
114 | 119 |
} |
Also available in: Unified diff
Change of API: move setting the EGL context back to the APP.