Revision e4330c89
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/examples/cubes/CubesSurfaceView.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
import org.distorted.examples.R; |
23 | 23 |
|
24 |
import android.app.ActivityManager; |
|
24 | 25 |
import android.content.Context; |
26 |
import android.content.pm.ConfigurationInfo; |
|
25 | 27 |
import android.opengl.GLSurfaceView; |
26 | 28 |
import android.util.AttributeSet; |
27 | 29 |
import android.view.MotionEvent; |
... | ... | |
46 | 48 |
if(!isInEditMode()) |
47 | 49 |
{ |
48 | 50 |
mRenderer = new CubesRenderer(this); |
51 |
final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); |
|
52 |
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo(); |
|
53 |
setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 ); |
|
49 | 54 |
setRenderer(mRenderer); |
50 | 55 |
Toast.makeText(context, R.string.example_rotate_toast , Toast.LENGTH_SHORT).show(); |
51 | 56 |
} |
Also available in: Unified diff
Change of API: move setting the EGL context back to the APP.