Project

General

Profile

« Previous | Next » 

Revision 525699f4

Added by Leszek Koltunski almost 8 years ago

Simplify SurfaceViews

View differences:

src/main/java/org/distorted/examples/aroundtheworld/AroundTheWorldSurfaceView.java
39 39
      if(!isInEditMode())
40 40
        {
41 41
        setEGLContextClientVersion(2);
42

  
43
        if( Build.FINGERPRINT.startsWith("generic") )
44
          {
45
          setEGLConfigChooser(8, 8, 8, 8, 16, 0);
46
          }
47

  
48 42
        mRenderer = new AroundTheWorldRenderer(this);
49 43
        setRenderer(mRenderer);
50 44
        }
src/main/java/org/distorted/examples/bean/BeanSurfaceView.java
33 33
      {
34 34
      super(context);
35 35
      setEGLContextClientVersion(2);
36
        
37
      if( Build.FINGERPRINT.startsWith("generic") )
38
        { 
39
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
40
        }
41
        
42 36
      setRenderer(new BeanRenderer(this));
43 37
      }
44 38
}
src/main/java/org/distorted/examples/catanddog/CatAndDogSurfaceView.java
33 33
      {
34 34
      super(context);
35 35
      setEGLContextClientVersion(2);
36
        
37
      if( Build.FINGERPRINT.startsWith("generic") )
38
        { 
39
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
40
        }
41
        
42 36
      setRenderer(new CatAndDogRenderer(this));
43 37
      }
44 38
}
src/main/java/org/distorted/examples/check/CheckSurfaceView.java
37 37
      if(!isInEditMode())
38 38
        {
39 39
        setEGLContextClientVersion(2);
40
        
41
        if( Build.FINGERPRINT.startsWith("generic") )
42
          { 
43
          setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
44
          }
45
    
46 40
        CheckRenderer renderer = new CheckRenderer(this);
47 41
        setRenderer(renderer);
48 42
        }
src/main/java/org/distorted/examples/cubes/CubesSurfaceView.java
47 47
      if(!isInEditMode())
48 48
        {
49 49
        setEGLContextClientVersion(2);
50
        
51
        if( Build.FINGERPRINT.startsWith("generic") )
52
          { 
53
          setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
54
          }
55
    
56 50
        mRenderer = new CubesRenderer(this);
57
        
58 51
        setRenderer(mRenderer);
59
        
60 52
        Toast.makeText(c, R.string.example_rotate_toast , Toast.LENGTH_SHORT).show();
61 53
        }
62 54
      }
src/main/java/org/distorted/examples/deform/DeformSurfaceView.java
41 41
      if(!isInEditMode())
42 42
        {
43 43
        setEGLContextClientVersion(2);
44
        
45
        if( Build.FINGERPRINT.startsWith("generic") )
46
          { 
47
          setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
48
          }
49
    
50 44
        mRenderer = new DeformRenderer(this);
51 45
        setRenderer(mRenderer);
52 46
        }
src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsSurfaceView.java
33 33
      {
34 34
      super(context);
35 35
      setEGLContextClientVersion(2);
36
        
37
      if( Build.FINGERPRINT.startsWith("generic") )
38
        { 
39
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
40
        }
41
        
42 36
      setRenderer(new DifferentBitmapsRenderer(this));
43 37
      }
44 38
}
src/main/java/org/distorted/examples/differenteffects/DifferentEffectsSurfaceView.java
33 33
      {
34 34
      super(context);
35 35
      setEGLContextClientVersion(2);
36
        
37
      if( Build.FINGERPRINT.startsWith("generic") )
38
        { 
39
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
40
        }
41
        
42 36
      setRenderer(new DifferentEffectsRenderer(this));
43 37
      }
44 38
}
src/main/java/org/distorted/examples/dynamic/DynamicSurfaceView.java
109 109
        {
110 110
        setFocusable(true);
111 111
        setFocusableInTouchMode(true);
112
        
113 112
        setEGLContextClientVersion(2);
114
        
115
        if( Build.FINGERPRINT.startsWith("generic") ) // when running on the emulator, insert a magic line that is
116
          {                                           // supposed to cure the 'no config chosen' crash on emulator startup
117
          setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
118
          }
119
        
120 113
        DynamicRenderer mRenderer = new DynamicRenderer(this);
121 114
        setRenderer(mRenderer);
122 115
        }
src/main/java/org/distorted/examples/effectqueue/EffectQueueSurfaceView.java
87 87
      {
88 88
      setFocusable(true);
89 89
      setFocusableInTouchMode(true);
90
       
91 90
      setEGLContextClientVersion(2);
92
        
93
      if( Build.FINGERPRINT.startsWith("generic") ) // when running on the emulator, insert a magic line that is
94
        {                                           // supposed to cure the 'no config chosen' crash on emulator startup
95
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
96
        }
97
        
91

  
98 92
      mRenderer = new EffectQueueRenderer(this);
99 93
      setRenderer(mRenderer);
100 94

  
src/main/java/org/distorted/examples/effects3d/Effects3DSurfaceView.java
41 41
    if(!isInEditMode())
42 42
      {
43 43
      setEGLContextClientVersion(2);
44
        
45
      if( Build.FINGERPRINT.startsWith("generic") )
46
        {
47
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);
48
        }
49

  
50 44
      mRenderer = new Effects3DRenderer(this);
51

  
52 45
      setRenderer(mRenderer);
53 46
      }
54 47
    }
src/main/java/org/distorted/examples/fbo/FBOSurfaceView.java
33 33
      {
34 34
      super(context);
35 35
      setEGLContextClientVersion(2);
36
        
37
      if( Build.FINGERPRINT.startsWith("generic") )
38
        { 
39
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
40
        }
41
        
42 36
      setRenderer(new FBORenderer(this));
43 37
      }
44 38
}
src/main/java/org/distorted/examples/flag/FlagSurfaceView.java
44 44
      if(!isInEditMode())
45 45
        {
46 46
        setEGLContextClientVersion(2);
47
        
48
        if( Build.FINGERPRINT.startsWith("generic") )
49
          { 
50
          setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
51
          }
52
    
53 47
        mRenderer = new FlagRenderer(this);
54
        
55 48
        setRenderer(mRenderer);
56 49
        }
57 50
      }
src/main/java/org/distorted/examples/fov/FOVSurfaceView.java
37 37
      if(!isInEditMode())
38 38
        {
39 39
        setEGLContextClientVersion(2);
40
        
41
        if( Build.FINGERPRINT.startsWith("generic") )
42
          { 
43
          setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
44
          }
45
    
46
        FOVRenderer renderer = new FOVRenderer(this);
47
        setRenderer(renderer);
40
        setRenderer(new FOVRenderer(this));
48 41
        }
49 42
      }
50 43
}
src/main/java/org/distorted/examples/girl/GirlSurfaceView.java
37 37
      super(c, attrs);
38 38
     
39 39
      setEGLContextClientVersion(2);
40
        
41
      if( Build.FINGERPRINT.startsWith("generic") )
42
        { 
43
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
44
        }
45

  
46 40
      mRenderer = new GirlRenderer(this);
47

  
48 41
      setRenderer(mRenderer);
49 42
      }
50 43

  
src/main/java/org/distorted/examples/listener/ListenerSurfaceView.java
33 33
      {
34 34
      super(context);
35 35
      setEGLContextClientVersion(2);
36
        
37
      if( Build.FINGERPRINT.startsWith("generic") )
38
        { 
39
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
40
        }
41
        
42 36
      setRenderer(new ListenerRenderer(this));
43 37
      }
44 38
}
src/main/java/org/distorted/examples/matrix3d/Matrix3DSurfaceView.java
40 40
    if(!isInEditMode())
41 41
      {
42 42
      setEGLContextClientVersion(2);
43
        
44
      if( Build.FINGERPRINT.startsWith("generic") )
45
        {
46
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);
47
        }
48

  
49 43
      mRenderer = new Matrix3DRenderer(this);
50

  
51 44
      setRenderer(mRenderer);
52 45
      }
53 46
    }
src/main/java/org/distorted/examples/monalisa/MonaLisaSurfaceView.java
33 33
      {
34 34
      super(context);
35 35
      setEGLContextClientVersion(2);
36
        
37
      if( Build.FINGERPRINT.startsWith("generic") )
38
        { 
39
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
40
        }
41
        
42 36
      setRenderer(new MonaLisaRenderer(this));
43 37
      }
44 38
}
src/main/java/org/distorted/examples/movingeffects/MovingEffectsSurfaceView.java
83 83
        {
84 84
        setFocusable(true);
85 85
        setFocusableInTouchMode(true);
86
        
87 86
        setEGLContextClientVersion(2);
88
        
89
        if( Build.FINGERPRINT.startsWith("generic") ) // when running on the emulator, insert a magic line that is
90
          {                                           // supposed to cure the 'no config chosen' crash on emulator startup
91
          setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
92
          }
93
        
94
        MovingEffectsRenderer mRenderer = new MovingEffectsRenderer(this);
95
        setRenderer(mRenderer);
87
        setRenderer(new MovingEffectsRenderer(this));
96 88
        }
97 89
      }
98 90

  
src/main/java/org/distorted/examples/olimpic/OlimpicSurfaceView.java
33 33
      {
34 34
      super(context);
35 35
      setEGLContextClientVersion(2);
36
        
37
      if( Build.FINGERPRINT.startsWith("generic") )
38
        { 
39
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
40
        }
41
        
42 36
      setRenderer(new OlimpicRenderer(this));
43 37
      }
44 38
}
src/main/java/org/distorted/examples/quaternion/QuaternionSurfaceView.java
27 27

  
28 28
class QuaternionSurfaceView extends GLSurfaceView 
29 29
  {
30
  public QuaternionSurfaceView(Context c) 
30
  public QuaternionSurfaceView(Context context)
31 31
    {
32
    super(c);
33
      
34
    if(!isInEditMode())
35
      {
36
      setEGLContextClientVersion(2);
37
        
38
      if( Build.FINGERPRINT.startsWith("generic") )
39
        { 
40
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
41
        }
42
        
43
      setRenderer(new QuaternionRenderer(this));
44
      }
32
    super(context);
33
    setEGLContextClientVersion(2);
34
    setRenderer(new QuaternionRenderer(this));
45 35
    }
46 36
  }
47 37

  
src/main/java/org/distorted/examples/save/SaveSurfaceView.java
35 35
  public SaveSurfaceView(Context c, AttributeSet attrs)
36 36
    {
37 37
    super(c, attrs);
38
     
39 38
    setEGLContextClientVersion(2);
40
      
41
    if( Build.FINGERPRINT.startsWith("generic") )
42
      { 
43
      setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
44
      }
45

  
46 39
    mRenderer = new SaveRenderer(this);
47

  
48 40
    setRenderer(mRenderer);
49 41
    }
50 42

  
src/main/java/org/distorted/examples/sink/SinkSurfaceView.java
31 31
    {
32 32
    super(context);
33 33
    setEGLContextClientVersion(2);
34
        
35
    if( Build.FINGERPRINT.startsWith("generic") )
36
      { 
37
      setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
38
      }
39
        
40 34
    setRenderer(new SinkRenderer(this));
41 35
    }
42 36
  }
src/main/java/org/distorted/examples/starwars/StarWarsSurfaceView.java
31 31
    {
32 32
    super(context);
33 33
    setEGLContextClientVersion(2);
34
        
35
    if( Build.FINGERPRINT.startsWith("generic") )
36
      { 
37
      setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
38
      }
39
        
40 34
    setRenderer(new StarWarsRenderer(this));
41 35
    }
42 36
  }
src/main/java/org/distorted/examples/wind/WindSurfaceView.java
40 40
      if(!isInEditMode())
41 41
        {
42 42
        setEGLContextClientVersion(2);
43
        
44
        if( Build.FINGERPRINT.startsWith("generic") )
45
          { 
46
          setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
47
          }
48
    
49 43
        mRenderer = new WindRenderer(this);
50 44
        setRenderer(mRenderer);
51 45
        }

Also available in: Unified diff