istereo
changeset 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 | e60f9d8af28d |
files | istereo.xcodeproj/project.pbxproj src/istereo.c src/ui.m src/ui.xib |
diffstat | 4 files changed, 16 insertions(+), 10 deletions(-) [+] |
line diff
1.1 --- a/istereo.xcodeproj/project.pbxproj Fri Sep 09 10:03:42 2011 +0300 1.2 +++ b/istereo.xcodeproj/project.pbxproj Fri Sep 09 10:25:03 2011 +0300 1.3 @@ -9,6 +9,7 @@ 1.4 /* Begin PBXBuildFile section */ 1.5 063C67DA1419CBFF00BA388B /* ui.m in Sources */ = {isa = PBXBuildFile; fileRef = 063C67D81419CBFF00BA388B /* ui.m */; }; 1.6 063C67DB1419CBFF00BA388B /* ui.xib in Resources */ = {isa = PBXBuildFile; fileRef = 063C67D91419CBFF00BA388B /* ui.xib */; }; 1.7 + 069605A71419F55300BD7787 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 069605A61419F55300BD7787 /* CoreGraphics.framework */; }; 1.8 069BEBC414188B070043D0BB /* conv.c in Sources */ = {isa = PBXBuildFile; fileRef = 069BEBBB14188B070043D0BB /* conv.c */; }; 1.9 069BEBC514188B070043D0BB /* file_jpeg.c in Sources */ = {isa = PBXBuildFile; fileRef = 069BEBBC14188B070043D0BB /* file_jpeg.c */; }; 1.10 069BEBC614188B070043D0BB /* file_png.c in Sources */ = {isa = PBXBuildFile; fileRef = 069BEBBD14188B070043D0BB /* file_png.c */; }; 1.11 @@ -134,6 +135,7 @@ 1.12 063C67D71419CBFF00BA388B /* ui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ui.h; path = src/ui.h; sourceTree = "<group>"; }; 1.13 063C67D81419CBFF00BA388B /* ui.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ui.m; path = src/ui.m; sourceTree = "<group>"; }; 1.14 063C67D91419CBFF00BA388B /* ui.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ui.xib; path = src/ui.xib; sourceTree = "<group>"; }; 1.15 + 069605A61419F55300BD7787 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 1.16 069BEBBB14188B070043D0BB /* conv.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = conv.c; path = libs/imago2/conv.c; sourceTree = "<group>"; }; 1.17 069BEBBC14188B070043D0BB /* file_jpeg.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = file_jpeg.c; path = libs/imago2/file_jpeg.c; sourceTree = "<group>"; }; 1.18 069BEBBD14188B070043D0BB /* file_png.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = file_png.c; path = libs/imago2/file_png.c; sourceTree = "<group>"; }; 1.19 @@ -314,6 +316,7 @@ 1.20 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 1.21 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */, 1.22 28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */, 1.23 + 069605A71419F55300BD7787 /* CoreGraphics.framework in Frameworks */, 1.24 ); 1.25 runOnlyForDeploymentPostprocessing = 0; 1.26 }; 1.27 @@ -599,6 +602,7 @@ 1.28 28FD14FF0DC6FC520079059D /* OpenGLES.framework */, 1.29 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 1.30 1D30AB110D05D00D00671497 /* Foundation.framework */, 1.31 + 069605A61419F55300BD7787 /* CoreGraphics.framework */, 1.32 ); 1.33 name = Frameworks; 1.34 sourceTree = "<group>";
2.1 --- a/src/istereo.c Fri Sep 09 10:03:42 2011 +0300 2.2 +++ b/src/istereo.c Fri Sep 09 10:25:03 2011 +0300 2.3 @@ -136,13 +136,12 @@ 2.4 render(tsec); 2.5 } else { 2.6 glViewport(0, 0, view_xsz, view_ysz); 2.7 - cam_aspect((float)view_ysz / (float)view_xsz); 2.8 + cam_aspect((float)view_xsz / (float)view_ysz); 2.9 2.10 gl_matrix_mode(GL_PROJECTION); 2.11 gl_load_identity(); 2.12 cam_proj_matrix(); 2.13 - gl_rotatef(-90, 0, 0, 1); 2.14 - 2.15 + 2.16 gl_matrix_mode(GL_MODELVIEW); 2.17 gl_load_identity(); 2.18 cam_view_matrix();
3.1 --- a/src/ui.m Fri Sep 09 10:03:42 2011 +0300 3.2 +++ b/src/ui.m Fri Sep 09 10:25:03 2011 +0300 3.3 @@ -28,6 +28,9 @@ 3.4 { 3.5 [super viewDidLoad]; 3.6 3.7 + self.view.center = CGPointMake(160, 240); 3.8 + self.view.transform = CGAffineTransformMakeRotation(M_PI / 2.0); 3.9 + 3.10 [slider_split setValue: 1.0 - split]; 3.11 sw_stereo.on = stereo ? YES : NO; 3.12 grp_mode.selectedSegmentIndex = use_bump ? 1 : 0; 3.13 @@ -35,10 +38,10 @@ 3.14 3.15 3.16 // Override to allow orientations other than the default portrait orientation. 3.17 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 3.18 +/*- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 3.19 // Return YES for supported orientations. 3.20 return interfaceOrientation == UIInterfaceOrientationLandscapeRight; 3.21 -} 3.22 +}*/ 3.23 3.24 3.25 - (void)didReceiveMemoryWarning {
4.1 --- a/src/ui.xib Fri Sep 09 10:03:42 2011 +0300 4.2 +++ b/src/ui.xib Fri Sep 09 10:25:03 2011 +0300 4.3 @@ -153,7 +153,7 @@ 4.4 <object class="IBUIButton" id="509948995"> 4.5 <reference key="NSNextResponder" ref="191373211"/> 4.6 <int key="NSvFlags">292</int> 4.7 - <string key="NSFrame">{{350, 136}, {110, 37}}</string> 4.8 + <string key="NSFrame">{{350, 263}, {110, 37}}</string> 4.9 <reference key="NSSuperview" ref="191373211"/> 4.10 <bool key="IBUIOpaque">NO</bool> 4.11 <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> 4.12 @@ -177,7 +177,7 @@ 4.13 </object> 4.14 </object> 4.15 </object> 4.16 - <string key="NSFrameSize">{480, 193}</string> 4.17 + <string key="NSFrameSize">{480, 320}</string> 4.18 <reference key="NSSuperview"/> 4.19 <object class="NSColor" key="IBUIBackgroundColor"> 4.20 <int key="NSColorSpace">1</int> 4.21 @@ -290,8 +290,8 @@ 4.22 <reference ref="337771867"/> 4.23 <reference ref="548530308"/> 4.24 <reference ref="108081265"/> 4.25 + <reference ref="799767528"/> 4.26 <reference ref="509948995"/> 4.27 - <reference ref="799767528"/> 4.28 </object> 4.29 <reference key="parent" ref="0"/> 4.30 </object> 4.31 @@ -370,11 +370,11 @@ 4.32 <bool key="EncodedWithXMLCoder">YES</bool> 4.33 <string>UI</string> 4.34 <string>UIResponder</string> 4.35 - <string>{{403, 479}, {480, 193}}</string> 4.36 + <string>{{403, 352}, {480, 320}}</string> 4.37 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 4.38 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 4.39 <object class="NSAffineTransform"> 4.40 - <bytes key="NSTransformStruct">P4AAAL+AAABDrwAAw4iAAA</bytes> 4.41 + <bytes key="NSTransformStruct">P4AAAL+AAABDrwAAwysAAA</bytes> 4.42 </object> 4.43 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 4.44 <object class="NSAffineTransform">