Example #1
0
        protected override void Initialize()
        {
            // Create a timer that will simulate the gameloop
            _timer          = new DispatcherTimer();
            _timer.Interval = TimeSpan.FromSeconds(1 / 60);
            _timer.Tick    += TimerTick;
            _timer.Start();

            // Create the graphics options and initialize FRB with them
            var graphicsOptions = new GraphicsOptions(this, Graphics);

            graphicsOptions.SuspendDeviceReset();
            graphicsOptions.ResolutionWidth  = RenderWidth;
            graphicsOptions.ResolutionHeight = RenderHeight;
            graphicsOptions.ResumeDeviceReset();
            FlatRedBallServices.InitializeFlatRedBall(this, Graphics, graphicsOptions);
            FlatRedBall.Screens.ScreenManager.Start(typeof(FlatRedBallWpf.Screens.MainScreen));

            if (false)
            {
                // Don't run this because we want the game's camera setup to run
                // Put if(false) so that it doesn't get re-generated
                CameraSetup.SetupCamera(SpriteManager.Camera, this.Graphics);
            }
            GlobalContent.Initialize();
            Mouse.ModifyMouseState += HandleModifyMouseState;

            FlatRedBall.Gui.GuiManager.Cursor.CustomIsActive = HandleCustomIsActive;

            base.Initialize();
        }
        protected override void Initialize()
        {
            // Create a timer that will simulate the gameloop
            _timer = new DispatcherTimer();
            _timer.Interval = TimeSpan.FromSeconds(1/60);
            _timer.Tick += TimerTick;
            _timer.Start();

            // Create the graphics options and initialize FRB with them
            var graphicsOptions = new GraphicsOptions(this, Graphics);
            graphicsOptions.SuspendDeviceReset();
            graphicsOptions.ResolutionWidth = RenderWidth;
            graphicsOptions.ResolutionHeight = RenderHeight;
            graphicsOptions.ResumeDeviceReset();
            FlatRedBallServices.InitializeFlatRedBall(this, Graphics, graphicsOptions);

            base.Initialize();
        }
Example #3
0
        protected override void Initialize()
        {
            // Create a timer that will simulate the gameloop
            _timer          = new DispatcherTimer();
            _timer.Interval = TimeSpan.FromSeconds(1 / 60);
            _timer.Tick    += TimerTick;
            _timer.Start();

            // Create the graphics options and initialize FRB with them
            var graphicsOptions = new GraphicsOptions(this, Graphics);

            graphicsOptions.SuspendDeviceReset();
            graphicsOptions.ResolutionWidth  = RenderWidth;
            graphicsOptions.ResolutionHeight = RenderHeight;
            graphicsOptions.ResumeDeviceReset();
            FlatRedBallServices.InitializeFlatRedBall(this, Graphics, graphicsOptions);

            base.Initialize();
        }