Esempio n. 1
0
        private EntityGame(Game game, GraphicsDeviceManager g, SpriteBatch spriteBatch, Rectangle viewport)
        {
            Game = game;
            Game.Exiting += (sender, args) => Exit();

            SpriteBatch = spriteBatch;
            Viewport = viewport;
            Assets.LoadConent(game);

            //Inject debug info into active state
            StateChanged += state => LastID = 1;
            StateChanged += state => _debugInfo = new DebugInfo(state, "DebugInfo");
            StateChanged += state => ActiveCamera = new Camera(state, "EntityEngineDefaultCamera");

            Log = new Log();
            Process p = Process.GetCurrentProcess();
            _ramCounter = new PerformanceCounter("Process", "Working Set", p.ProcessName);
            _cpuCounter = new PerformanceCounter("Process", "% Processor Time", p.ProcessName);

            MakeWindow(g, viewport);
        }
Esempio n. 2
0
        private EntityGame(Game game, SpriteBatch spriteBatch)
        {
            Game = game;
            Game.Exiting += (sender, args) => Exit();

            SpriteBatch = spriteBatch;
            Assets.LoadConent(game);

            //Inject debug info into active state
            StateChanged += state => LastID = 1;
            StateChanged += state => _debugInfo = new DebugInfo(state, "DebugInfo");
            StateChanged += state => ActiveCamera = new Camera(state, "EntityEngineDefaultCamera");

            Log = new Log();

            //Start counters

            Process p = Process.GetCurrentProcess();
            _ramCounter = new PerformanceCounter("Process", "Working Set", p.ProcessName);
            _cpuCounter = new PerformanceCounter("Process", "% Processor Time", p.ProcessName);
        }