ios stuff

This commit is contained in:
Vladislav Khorev 2013-02-04 09:20:51 +00:00
parent 98adb4ffda
commit ac98475101
6 changed files with 190 additions and 164 deletions

View File

@ -18,13 +18,16 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{ {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch. // Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil]; self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
} else { } else {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil]; self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil];
} }
self.window.rootViewController = self.viewController; self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
return YES; return YES;
} }

View File

@ -73,7 +73,8 @@ extern GLKView* defaultView;
} else { } else {
return YES; return YES;
}*/ }*/
return UIInterfaceOrientationIsLandscape(interfaceOrientation); //return UIInterfaceOrientationIsLandscape(interfaceOrientation);
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
} }
- (void)setupGL - (void)setupGL

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00"> <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data> <data>
<int key="IBDocument.SystemTarget">1296</int> <int key="IBDocument.SystemTarget">1536</int>
<string key="IBDocument.SystemVersion">11E53</string> <string key="IBDocument.SystemVersion">11E53</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string> <string key="IBDocument.InterfaceBuilderVersion">2844</string>
<string key="IBDocument.AppKitVersion">1138.47</string> <string key="IBDocument.AppKitVersion">1138.47</string>
<string key="IBDocument.HIToolboxVersion">569.00</string> <string key="IBDocument.HIToolboxVersion">569.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">1181</string> <string key="NS.object.0">1930</string>
</object> </object>
<array key="IBDocument.IntegratedClassDependencies"> <array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string> <string>IBProxyObject</string>
@ -33,8 +33,10 @@
<object class="IBUIView" id="184854543"> <object class="IBUIView" id="184854543">
<reference key="NSNextResponder"/> <reference key="NSNextResponder"/>
<int key="NSvFlags">274</int> <int key="NSvFlags">274</int>
<string key="NSFrameSize">{320, 460}</string> <string key="NSFrameSize">{320, 480}</string>
<reference key="NSSuperview"/> <reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor"> <object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int> <int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes> <bytes key="NSWhite">MQA</bytes>
@ -97,15 +99,34 @@
<nil key="sourceID"/> <nil key="sourceID"/>
<int key="maxID">4</int> <int key="maxID">4</int>
</object> </object>
<object class="IBClassDescriber" key="IBDocument.Classes"/> <object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">CustomGLKView</string>
<string key="superclassName">GLKView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/CustomGLKView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">ViewController</string>
<string key="superclassName">GLKViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/ViewController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int> <int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string> <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<real value="1296" key="NS.object.0"/> <real value="1536" key="NS.object.0"/>
</object> </object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int> <int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">1181</string> <string key="IBCocoaTouchPluginVersion">1930</string>
</data> </data>
</archive> </archive>

View File

@ -7,7 +7,8 @@ TMyApplication App;
extern "C" void AppInit() extern "C" void AppInit()
{ {
App.OuterInit(480, 320, 480, 320); App.OuterInit(320, 480, 320, 480);
//App.OuterInit(480, 320, 480, 320);
} }

View File

@ -38,13 +38,13 @@
<true/> <true/>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array> </array>
<key>UISupportedInterfaceOrientations~ipad</key> <key>UISupportedInterfaceOrientations~ipad</key>
<array> <array>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array> </array>
</dict> </dict>
</plist> </plist>

View File

@ -282,7 +282,7 @@ void TMyApplication::InnerOnMove(vec2 shift)
vec3 rotation = Normalize(vec3(RotateShift, 0)); //Inverse vec3 rotation = Normalize(vec3(RotateShift, 0)); //Inverse
rotation.v[1] =-rotation.v[1]; //Inverse //rotation.v[1] =-rotation.v[1]; //Inverse
vec3 z = vec3(0,0,-1); vec3 z = vec3(0,0,-1);