Revision 1746198f
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/fbo/FBOSurfaceView.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
import android.content.Context; |
23 | 23 |
import android.opengl.GLSurfaceView; |
24 |
import android.util.AttributeSet; |
|
24 | 25 |
|
25 | 26 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
26 | 27 |
|
27 | 28 |
class FBOSurfaceView extends GLSurfaceView |
28 | 29 |
{ |
30 |
private FBORenderer mRenderer; |
|
31 |
|
|
29 | 32 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
30 | 33 |
|
31 |
public FBOSurfaceView(Context context) |
|
34 |
public FBOSurfaceView(Context c, AttributeSet attrs) |
|
35 |
{ |
|
36 |
super(c, attrs); |
|
37 |
|
|
38 |
if(!isInEditMode()) |
|
39 |
{ |
|
40 |
setEGLContextClientVersion(2); |
|
41 |
mRenderer = new FBORenderer(this); |
|
42 |
setRenderer(mRenderer); |
|
43 |
} |
|
44 |
} |
|
45 |
|
|
46 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
47 |
|
|
48 |
public FBORenderer getRenderer() |
|
32 | 49 |
{ |
33 |
super(context); |
|
34 |
setEGLContextClientVersion(2); |
|
35 |
setRenderer(new FBORenderer(this)); |
|
50 |
return mRenderer; |
|
36 | 51 |
} |
37 | 52 |
} |
38 | 53 |
|
Also available in: Unified diff
FBO APP: add dynamic adding/removing the DEPTH attachment.