Exemplo n.º 1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content. Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //Register our ContentManager
            //ContentButler.setGame(this);
            Master.Initialize(this);

            //Setup screen display/graphics device
            ViewportHandler.SetScreen(ScreenWidth, ScreenHeight);
            graphics.PreferredBackBufferWidth       = ViewportHandler.GetWidth();
            graphics.PreferredBackBufferHeight      = ViewportHandler.GetHeight();
            graphics.SynchronizeWithVerticalRetrace = true;
            graphics.IsFullScreen = false;
            graphics.ApplyChanges();
            Graphics.CGraphics.acquireGraphics(ref graphics);



            Master.SetClearColor(Color.CornflowerBlue);

            CTextures.init(Content);

            Master.Push(new DevMenu());
            //Master.Push(new PlayableState());

            Master.GetInputManager().AddInputHandler(new CInput());

            base.Initialize();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content. Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //Register our ContentManager
            //ContentButler.setGame(this);
            Master.Initialize(this);

            //Setup screen display/graphics device
            ViewportHandler.SetScreen(ScreenWidth, ScreenHeight);
            graphics.PreferredBackBufferWidth       = ViewportHandler.GetWidth();
            graphics.PreferredBackBufferHeight      = ViewportHandler.GetHeight();
            graphics.SynchronizeWithVerticalRetrace = true;
            graphics.IsFullScreen = false;
            graphics.ApplyChanges();
            Graphics.CGraphics.acquireGraphics(ref graphics);
            graphics.SynchronizeWithVerticalRetrace = true;
            CGraphics.fullScreenRenderTarget        = new RenderTarget2D(CGraphics.GPU, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight, true, SurfaceFormat.Color, DepthFormat.Depth24);

            _fpsTimer.Elapsed += new ElapsedEventHandler(_fpsHandler);
            _fpsTimer.Enabled  = true;
            _fpsTimer.Start();

            Master.SetClearColor(Color.Black);

            CTextures.init(Content);

            Master.Push(new DevMenu());
            //Master.Push(new PlayableState());

            Master.GetInputManager().AddInputHandler(new CInput());
            CMasterControl.glblInput        = Master.GetInputManager().GetCurrentInputHandler() as Input.CInput;
            CMasterControl.healthController = new Actors.HUD.health.CHealthController(20, 78);
            CMasterControl.magicMeter       = new Actors.HUD.magic.CMagicMeter();

            scaleMatrix = Matrix.CreateScale(
                3f,
                3f,
                1f);

            base.Initialize();
        }
Exemplo n.º 3
0
        protected override void Initialize()
        {
            //GEARSDEBUG VERSION. This is the version of the game module, not the VGE.
            VersionManager.Version = "ALPHA";

            //Register our Game to Master
            Master.Initialize(this);

            //Setup screen display/graphics device
            ViewportHandler.SetScreen(GameResolutionWidth, GameResolutionHeight);
            graphics.PreferredBackBufferWidth  = WindowResolutionWidth;
            graphics.PreferredBackBufferHeight = WindowResolutionHeight;
            //graphics.
            graphics.IsFullScreen = false;
            //graphics.
            graphics.ApplyChanges();


            #if DEBUG
            Window.Title = "Gears [Debug] v." + VersionManager.Version + " using GearsVGE v." + VersionManager.GearsVGEVersion;

            // MAYBE TODO: Make this enum based for easier switching?
            //  DEBUG :: The uncommented line will change the default state that runs first.
            //  Only one of the following Master.Push() lines should be uncommented at a time.
            //Master.Push(new Splash());    //Uncomment this line to start game normally.
            Master.Push(new DebugBootstrapper());        //Uncomment this line to start the game with debug menu.
            //  END of Master.Push() lines
            #else //release
            Window.Title = "Gears v." + VersionManager.Version;
            Master.Push(new Splash());     //Start game normally
            #endif


            Gears.Cloud.Media.AudioPlayer.start();

            //Master.GetInputManager().GetCurrentInputHandler()
            base.Initialize();
        }