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