Revision e4330c89
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/examples/multiblur/MultiblurSurfaceView.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.examples.multiblur; |
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.util.AttributeSet; |
25 | 27 |
import android.view.MotionEvent; |
... | ... | |
46 | 48 |
if(!isInEditMode()) |
47 | 49 |
{ |
48 | 50 |
mRenderer = new MultiblurRenderer(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.