istereo
view src/ui.m @ 43:73813c1176de
better hgignore
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 14 Aug 2015 04:33:42 +0300 |
parents | 834503dcb486 |
children |
line source
1 /*
2 Stereoscopic tunnel for iOS.
3 Copyright (C) 2011 John Tsiombikas <nuclear@member.fsf.org>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
20 #import "ui.h"
22 extern int stereo;
23 extern int use_bump;
24 extern float split;
27 @implementation UI
29 @synthesize bn_done;
30 @synthesize slider_split;
31 @synthesize grp_mode;
32 @synthesize sw_stereo;
34 // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
35 /*
36 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
37 {
38 self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
39 if(self) {
40 }
41 return self;
42 }*/
45 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
46 - (void)viewDidLoad
47 {
48 [super viewDidLoad];
50 self.view.center = CGPointMake(160, 240);
51 self.view.transform = CGAffineTransformMakeRotation(M_PI / 2.0);
53 [slider_split setValue: 1.0 - split];
54 sw_stereo.on = stereo ? YES : NO;
55 grp_mode.selectedSegmentIndex = use_bump ? 1 : 0;
56 }
59 // Override to allow orientations other than the default portrait orientation.
60 /*- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
61 // Return YES for supported orientations.
62 return interfaceOrientation == UIInterfaceOrientationLandscapeRight;
63 }*/
66 - (void)didReceiveMemoryWarning {
67 // Releases the view if it doesn't have a superview.
68 [super didReceiveMemoryWarning];
70 // Release any cached data, images, etc. that aren't in use.
71 }
73 - (void)viewDidUnload {
74 [super viewDidUnload];
75 // Release any retained subviews of the main view.
76 // e.g. self.myOutlet = nil;
77 }
80 - (void)dealloc {
81 [super dealloc];
82 }
84 -(IBAction) done_clicked: (id) sender
85 {
86 self.view.hidden = YES;
87 }
89 -(IBAction) split_changed: (id) sender
90 {
91 split = 1.0 - slider_split.value;
92 }
94 -(IBAction) stereo_changed: (id) sender
95 {
96 stereo = sw_stereo.on;
97 }
99 -(IBAction) mode_changed: (id) sender
100 {
101 use_bump = grp_mode.selectedSegmentIndex;
102 }
105 @end