1 |
427ab7bf
|
Leszek Koltunski
|
|
2 |
5068fa06
|
Leszek Koltunski
|
package org.distorted.examples.fov;
|
3 |
427ab7bf
|
Leszek Koltunski
|
|
4 |
5068fa06
|
Leszek Koltunski
|
import org.distorted.library.Distorted;
|
5 |
|
|
import org.distorted.examples.R;
|
6 |
427ab7bf
|
Leszek Koltunski
|
|
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 |
|
|
}
|