예제 #1
0
파일: Game.cs 프로젝트: pquinn/Apoc
        public StarterGame()
        {
            // Default XNA setup.
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // Required for lighting system.
            graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;

            graphics.PreferredBackBufferWidth  = 1000;
            graphics.PreferredBackBufferHeight = 600;

            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromTicks(333333);

            // Create the screen factory and add it to the Services
            screenFactory = new ScreenFactory();
            Services.AddService(typeof(IScreenFactory), screenFactory);

            //Create a new instance of the Screen Manager
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            database = new SQLiteDatabase();

            Instance = this;

#if WINDOWS_PHONE
            graphics.IsFullScreen = true;

            // Choose whether you want a landscape or portait game by using one of the two helper functions.
            InitializeLandscapeGraphics();
            // InitializePortraitGraphics();
#else
            graphics.IsFullScreen = false;
#endif

#if WINDOWS_PHONE
            // Hook events on the PhoneApplicationService so we're notified of the application's life cycle
            Microsoft.Phone.Shell.PhoneApplicationService.Current.Launching +=
                new EventHandler <Microsoft.Phone.Shell.LaunchingEventArgs>(GameLaunching);
            Microsoft.Phone.Shell.PhoneApplicationService.Current.Activated +=
                new EventHandler <Microsoft.Phone.Shell.ActivatedEventArgs>(GameActivated);
            Microsoft.Phone.Shell.PhoneApplicationService.Current.Deactivated +=
                new EventHandler <Microsoft.Phone.Shell.DeactivatedEventArgs>(GameDeactivated);
#else
            // On Windows and Xbox we just add the initial screens
            AddInitialScreens();
#endif

            // AudioManager.Initialize(this);


            // Required for lighting system.
            screenManager.splashScreenGameComponent = new SplashScreenGameComponent(this);
            Components.Add(screenManager.splashScreenGameComponent);
        }
예제 #2
0
파일: Game.cs 프로젝트: pquinn/Apoc
            static void Main(string[] args)
            {
#if WINDOWS
                // Improved ui.
                System.Windows.Forms.Application.EnableVisualStyles();
#endif

                using (StarterGame game = new StarterGame())
                    game.Run();
            }
예제 #3
0
파일: Game.cs 프로젝트: pquinn/Apoc
        public StarterGame()
        {
            // Default XNA setup.
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // Required for lighting system.
            graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;

            graphics.PreferredBackBufferWidth = 1000;
            graphics.PreferredBackBufferHeight = 600;

            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromTicks(333333);

            // Create the screen factory and add it to the Services
            screenFactory = new ScreenFactory();
            Services.AddService(typeof(IScreenFactory), screenFactory);

            //Create a new instance of the Screen Manager
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            database = new SQLiteDatabase();

            Instance = this;

            #if WINDOWS_PHONE
            graphics.IsFullScreen = true;

            // Choose whether you want a landscape or portait game by using one of the two helper functions.
            InitializeLandscapeGraphics();
            // InitializePortraitGraphics();
            #else
            graphics.IsFullScreen = false;
            #endif

            #if WINDOWS_PHONE
            // Hook events on the PhoneApplicationService so we're notified of the application's life cycle
            Microsoft.Phone.Shell.PhoneApplicationService.Current.Launching +=
                new EventHandler<Microsoft.Phone.Shell.LaunchingEventArgs>(GameLaunching);
            Microsoft.Phone.Shell.PhoneApplicationService.Current.Activated +=
                new EventHandler<Microsoft.Phone.Shell.ActivatedEventArgs>(GameActivated);
            Microsoft.Phone.Shell.PhoneApplicationService.Current.Deactivated +=
                new EventHandler<Microsoft.Phone.Shell.DeactivatedEventArgs>(GameDeactivated);
            #else
            // On Windows and Xbox we just add the initial screens
            AddInitialScreens();
            #endif

            // AudioManager.Initialize(this);

            // Required for lighting system.
            screenManager.splashScreenGameComponent = new SplashScreenGameComponent(this);
            Components.Add(screenManager.splashScreenGameComponent);
        }
예제 #4
0
파일: Game.cs 프로젝트: pquinn/Apoc
            static void Main(string[] args)
            {
                #if WINDOWS
                // Improved ui.
                System.Windows.Forms.Application.EnableVisualStyles();
                #endif

                using (StarterGame game = new StarterGame())
                    game.Run();
            }