Project

General

Profile

« Previous | Next » 

Revision aedd9013

Added by Leszek Koltunski almost 7 years ago

First try to convert the Stencil app to a dual (directly to Screen / through intermediate Framebuffer) mode.
Doesn't work yet ( API is inconvenient / plain wrong )

View differences:

src/main/java/org/distorted/examples/stencil/StencilSurfaceView.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 StencilSurfaceView extends GLSurfaceView
28 29
{
30
   private StencilRenderer mRenderer;
31

  
29 32
///////////////////////////////////////////////////////////////////////////////////////////////////
30 33
   
31
    public StencilSurfaceView(Context context)
32
      {
33
      super(context);
34
      setRenderer(new StencilRenderer(this));
35
      }
34
   public StencilSurfaceView(Context context, AttributeSet attrs)
35
     {
36
     super(context,attrs);
37

  
38
     if(!isInEditMode())
39
       {
40
       mRenderer = new StencilRenderer(this);
41
       setRenderer(mRenderer);
42
       }
43
     }
44

  
45
///////////////////////////////////////////////////////////////////////////////////////////////////
46

  
47
   public StencilRenderer getRenderer()
48
     {
49
     return mRenderer;
50
     }
36 51
}
37 52

  

Also available in: Unified diff