Revision 13fde129
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/examples/sink/SinkSurfaceView.java | ||
---|---|---|
23 | 23 |
import android.content.Context; |
24 | 24 |
import android.content.pm.ConfigurationInfo; |
25 | 25 |
import android.opengl.GLSurfaceView; |
26 |
import android.util.AttributeSet; |
|
26 | 27 |
|
27 | 28 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
28 | 29 |
|
29 |
class SinkSurfaceView extends GLSurfaceView |
|
30 |
{ |
|
31 |
public SinkSurfaceView(Context context) |
|
32 |
{ |
|
33 |
super(context); |
|
34 |
final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); |
|
35 |
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo(); |
|
36 |
setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 ); |
|
37 |
setRenderer(new SinkRenderer(this)); |
|
38 |
} |
|
39 |
} |
|
30 |
class SinkSurfaceView extends GLSurfaceView |
|
31 |
{ |
|
32 |
private SinkRenderer mRenderer; |
|
33 |
|
|
34 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
35 |
|
|
36 |
public SinkSurfaceView(Context context, AttributeSet attrs) |
|
37 |
{ |
|
38 |
super(context, attrs); |
|
39 |
|
|
40 |
if(!isInEditMode()) |
|
41 |
{ |
|
42 |
mRenderer = new SinkRenderer(this); |
|
43 |
final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); |
|
44 |
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo(); |
|
45 |
setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 ); |
|
46 |
setRenderer(mRenderer); |
|
47 |
} |
|
48 |
} |
|
49 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
50 |
|
|
51 |
public SinkRenderer getRenderer() |
|
52 |
{ |
|
53 |
return mRenderer; |
|
54 |
} |
|
55 |
} |
|
40 | 56 |
|
Also available in: Unified diff
Change the Sink app. The point: test Sink effect at extreme strengths.