Project

General

Profile

« Previous | Next » 

Revision b5636dbf

Added by Leszek Koltunski about 7 years ago

Improve Dynamic and FBO apps.

View differences:

src/main/java/org/distorted/examples/fbo/FBOActivity.java
30 30

  
31 31
public class FBOActivity extends Activity 
32 32
{
33
    private boolean mDepth;
34

  
33 35
///////////////////////////////////////////////////////////////////////////////////////////////////
34 36
    
35 37
    @Override
36
    protected void onCreate(Bundle icicle) 
38
    protected void onCreate(Bundle savedState)
37 39
      {
38
      super.onCreate(icicle);
40
      super.onCreate(savedState);
39 41
      setContentView(R.layout.fbolayout);
42

  
43
      if( savedState==null )
44
        {
45
        mDepth = true;
46
        }
40 47
      }
41 48

  
42 49
///////////////////////////////////////////////////////////////////////////////////////////////////
......
78 85
      FBORenderer renderer = view.getRenderer();
79 86

  
80 87
      renderer.setDepth(true);
88
      mDepth = true;
81 89
      }
82 90

  
83 91
///////////////////////////////////////////////////////////////////////////////////////////////////
......
88 96
      FBORenderer renderer = view.getRenderer();
89 97

  
90 98
      renderer.setDepth(false);
99
      mDepth = false;
91 100
      }
101

  
102
///////////////////////////////////////////////////////////////////////////////////////////////////
103

  
104
    @Override
105
    public void onSaveInstanceState(Bundle savedInstanceState)
106
      {
107
      super.onSaveInstanceState(savedInstanceState);
108
      savedInstanceState.putBoolean("depth", mDepth);
109
      }
110

  
111
///////////////////////////////////////////////////////////////////////////////////////////////////
112

  
113
    @Override
114
    public void onRestoreInstanceState(Bundle savedInstanceState)
115
      {
116
      super.onRestoreInstanceState(savedInstanceState);
117

  
118
      mDepth = savedInstanceState.getBoolean("depth");
119

  
120
      if(mDepth) DepthYes(null);
121
      else       DepthNo(null);
122
      }
123

  
92 124
}

Also available in: Unified diff