Game main WIP.
authorchsieh <chester.developer@hotmail.com>
Thu, 28 Apr 2011 07:43:01 +0000 (00:43 -0700)
committerchsieh <chester.developer@hotmail.com>
Thu, 28 Apr 2011 07:43:01 +0000 (00:43 -0700)
Littlest.xcodeproj/project.pbxproj
Littlest/Game/GameMain.h [new file with mode: 0644]
Littlest/Game/GameMain.m [new file with mode: 0644]

index 93b507c..cae4ba3 100644 (file)
                4B8CC1CB135BFEDE00B3E49F /* LittlestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B8CC1BC135BFEDE00B3E49F /* LittlestViewController.m */; };
                4BE72E371367CCB600E8F668 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BE72E361367CCB600E8F668 /* RootViewController.m */; };
                4BE72E3D1367CE5100E8F668 /* GLES-Render.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BE72E3C1367CE5100E8F668 /* GLES-Render.mm */; };
+               4BE72E461367CF9B00E8F668 /* GameMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BE72E451367CF9B00E8F668 /* GameMain.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
                4BE72E381367CD1400E8F668 /* GameConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GameConfig.h; path = OS/GameConfig.h; sourceTree = "<group>"; };
                4BE72E3B1367CE5100E8F668 /* GLES-Render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "GLES-Render.h"; path = "Engine/Render/GLES-Render.h"; sourceTree = "<group>"; };
                4BE72E3C1367CE5100E8F668 /* GLES-Render.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "GLES-Render.mm"; path = "Engine/Render/GLES-Render.mm"; sourceTree = "<group>"; };
+               4BE72E441367CF9B00E8F668 /* GameMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameMain.h; sourceTree = "<group>"; };
+               4BE72E451367CF9B00E8F668 /* GameMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameMain.m; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
                        isa = PBXGroup;
                        children = (
                                4B8CC1C1135BFEDE00B3E49F /* Scene */,
+                               4BE72E441367CF9B00E8F668 /* GameMain.h */,
+                               4BE72E451367CF9B00E8F668 /* GameMain.m */,
                        );
                        path = Game;
                        sourceTree = "<group>";
                                4B8CC1CB135BFEDE00B3E49F /* LittlestViewController.m in Sources */,
                                4BE72E371367CCB600E8F668 /* RootViewController.m in Sources */,
                                4BE72E3D1367CE5100E8F668 /* GLES-Render.mm in Sources */,
+                               4BE72E461367CF9B00E8F668 /* GameMain.m in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/Littlest/Game/GameMain.h b/Littlest/Game/GameMain.h
new file mode 100644 (file)
index 0000000..1c2c6d9
--- /dev/null
@@ -0,0 +1,26 @@
+//
+//  GameMain.h
+//  Littlest
+//
+//  Created by Doris Chen on 4/26/11.
+//  Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@class RootViewController;
+
+@interface GameMain : NSObject {
+       UIWindow*           window;
+       RootViewController* viewController;
+}
+
+@property (nonatomic, retain) UIWindow *window;
+
++(GameMain*) createGameMain;
++(void) runWithWindow:(id)uiWindowId;
+
+-(void) initialize:(UIWindow*)uiWindow;
+-(void) run;
+
+@end
diff --git a/Littlest/Game/GameMain.m b/Littlest/Game/GameMain.m
new file mode 100644 (file)
index 0000000..7807dd0
--- /dev/null
@@ -0,0 +1,41 @@
+//
+//  GameMain.m
+//  Littlest
+//
+//  Created by Doris Chen on 4/26/11.
+//  Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "GameMain.h"
+#import <UIKit/UIKit.h>
+
+@implementation GameMain
+
+@synthesize window;
+
++(GameMain*) createGameMain {
+  if ( (self = [super init]) )
+  {
+    return [[GameMain alloc] init];
+  }
+  return Nil;
+}
+
++(void) runWithWindow:(id)uiWindowId {
+  GameMain* game = [GameMain createGameMain];
+  [game initialize: (UIWindow*)uiWindowId];
+  [game run];
+}
+
+-(void) initialize:(UIWindow *)uiWindow {
+  window = uiWindow;
+}
+
+-(void) run {
+  bool quit = false;
+  while (!quit) {
+    
+  }
+}
+
+@end