Project

General

Profile

Download (2.67 KB) Statistics
| Branch: | Revision:

examples / src / main / java / org / distorted / examples / fov / FOVActivity.java @ 5068fa06

1

    
2
package org.distorted.examples.fov;
3

    
4
import org.distorted.library.Distorted;
5
import org.distorted.examples.R;
6

    
7
import android.app.Activity;
8
import android.opengl.GLSurfaceView;
9
import android.os.Bundle;
10
import android.widget.SeekBar;
11
import android.widget.TextView;
12
import android.widget.SeekBar.OnSeekBarChangeListener;
13

    
14
///////////////////////////////////////////////////////////////////////////////////////////////////
15

    
16
public class FOVActivity extends Activity implements OnSeekBarChangeListener
17
{
18
    private SeekBar barFOV;
19
    private TextView textFOV;
20
    
21
///////////////////////////////////////////////////////////////////////////////////////////////////
22
    
23
    @Override
24
    protected void onCreate(Bundle icicle) 
25
      {
26
      super.onCreate(icicle);
27
      setContentView(R.layout.fovlayout);
28
       
29
      barFOV = (SeekBar)findViewById(R.id.seekFOV);
30
      barFOV.setOnSeekBarChangeListener(this); 
31
        
32
      textFOV = (TextView)findViewById(R.id.textFOV);
33
     
34
      barFOV.setProgress(50);
35
      
36
      textFOV.setText("FOV: 50");
37
      }
38

    
39
///////////////////////////////////////////////////////////////////////////////////////////////////
40
    
41
    @Override
42
    protected void onPause() 
43
      {
44
      GLSurfaceView mView = (GLSurfaceView) this.findViewById(R.id.surfaceViewFOV);
45
      mView.onPause();
46
      
47
      super.onPause();
48
      }
49

    
50
///////////////////////////////////////////////////////////////////////////////////////////////////
51
    
52
    @Override
53
    protected void onResume() 
54
      {
55
      super.onResume();
56
      
57
      GLSurfaceView mView = (GLSurfaceView) this.findViewById(R.id.surfaceViewFOV);
58
      mView.onResume();    
59
      }
60
 
61
///////////////////////////////////////////////////////////////////////////////////////////////////
62
    
63
    @Override
64
    protected void onDestroy() 
65
      {
66
      Distorted.onDestroy();  
67
      super.onDestroy();
68
      }
69

    
70
///////////////////////////////////////////////////////////////////////////////////////////////////
71
    
72
    public void onProgressChanged(SeekBar bar, int progress, boolean fromUser) 
73
      {
74
      switch (bar.getId()) 
75
        {
76
        case R.id.seekFOV: FOVRenderer.setFOV(progress);
77
                           textFOV.setText("FOV: "+progress);
78
                           break;
79
        }
80
      }
81

    
82
///////////////////////////////////////////////////////////////////////////////////////////////////
83

    
84
    public void onStartTrackingTouch(SeekBar bar) { }
85
    
86
///////////////////////////////////////////////////////////////////////////////////////////////////
87

    
88
    public void onStopTrackingTouch(SeekBar bar)  { }
89

    
90
///////////////////////////////////////////////////////////////////////////////////////////////////
91
    
92
}
(1-1/3)