istereo

view src/ui.m @ 36:834503dcb486

fixed the rotated gui problem
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 09 Sep 2011 10:25:03 +0300
parents 23e5d274b2a2
children ff055bff6a15
line source
1 #import "ui.h"
3 extern int stereo;
4 extern int use_bump;
5 extern float split;
8 @implementation UI
10 @synthesize bn_done;
11 @synthesize slider_split;
12 @synthesize grp_mode;
13 @synthesize sw_stereo;
15 // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
16 /*
17 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
18 {
19 self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
20 if(self) {
21 }
22 return self;
23 }*/
26 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
27 - (void)viewDidLoad
28 {
29 [super viewDidLoad];
31 self.view.center = CGPointMake(160, 240);
32 self.view.transform = CGAffineTransformMakeRotation(M_PI / 2.0);
34 [slider_split setValue: 1.0 - split];
35 sw_stereo.on = stereo ? YES : NO;
36 grp_mode.selectedSegmentIndex = use_bump ? 1 : 0;
37 }
40 // Override to allow orientations other than the default portrait orientation.
41 /*- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
42 // Return YES for supported orientations.
43 return interfaceOrientation == UIInterfaceOrientationLandscapeRight;
44 }*/
47 - (void)didReceiveMemoryWarning {
48 // Releases the view if it doesn't have a superview.
49 [super didReceiveMemoryWarning];
51 // Release any cached data, images, etc. that aren't in use.
52 }
54 - (void)viewDidUnload {
55 [super viewDidUnload];
56 // Release any retained subviews of the main view.
57 // e.g. self.myOutlet = nil;
58 }
61 - (void)dealloc {
62 [super dealloc];
63 }
65 -(IBAction) done_clicked: (id) sender
66 {
67 self.view.hidden = YES;
68 }
70 -(IBAction) split_changed: (id) sender
71 {
72 split = 1.0 - slider_split.value;
73 }
75 -(IBAction) stereo_changed: (id) sender
76 {
77 stereo = sw_stereo.on;
78 }
80 -(IBAction) mode_changed: (id) sender
81 {
82 use_bump = grp_mode.selectedSegmentIndex;
83 }
86 @end