Exemplo n.º 1
0
        public void Run(GameContext gameContext)
        {
            gameWindow = CreateWindow(gameContext);

            // Register on Activated
            gameWindow.Activated   += OnActivated;
            gameWindow.Deactivated += OnDeactivated;
            gameWindow.InitCallback = game.InitializeBeforeRun;
            gameWindow.RunCallback  = game.Tick;
            gameWindow.ExitCallback = () => OnExiting(this, EventArgs.Empty);

            var windowCreated = WindowCreated;

            if (windowCreated != null)
            {
                windowCreated(this, EventArgs.Empty);
            }

            gameWindow.Run();
        }
Exemplo n.º 2
0
        public void Run(GameContext gameContext)
        {
            gameWindow = CreateWindow(gameContext);

            // set the mouse visibility in case if it was set in the game constructor:
            gameWindow.IsMouseVisible = game.IsMouseVisible;

            // Register on Activated
            gameWindow.Activated   += OnActivated;
            gameWindow.Deactivated += OnDeactivated;
            gameWindow.InitCallback = game.InitializeBeforeRun;
            gameWindow.RunCallback  = game.Tick;
            gameWindow.ExitCallback = () => OnExiting(this, EventArgs.Empty);

            var windowCreated = WindowCreated;

            if (windowCreated != null)
            {
                windowCreated(this, EventArgs.Empty);
            }

            gameWindow.Run();
        }
Exemplo n.º 3
0
        public void Run(GameContext gameContext)
        {
            gameWindow = CreateWindow(gameContext);

            // Register on Activated 
            gameWindow.Activated += OnActivated;
            gameWindow.Deactivated += OnDeactivated;
            gameWindow.InitCallback = game.InitializeBeforeRun;
            gameWindow.RunCallback = game.Tick;
            gameWindow.ExitCallback = () => OnExiting(this, EventArgs.Empty);

            var windowCreated = WindowCreated;
            if (windowCreated != null)
            {
                windowCreated(this, EventArgs.Empty);
            }

            gameWindow.Run();
        }
Exemplo n.º 4
0
        public void Run(GameContext gameContext)
        {
            gameWindow = CreateWindow(gameContext);

            // set the mouse visibility in case if it was set in the game constructor:
            gameWindow.IsMouseVisible = game.IsMouseVisible;

            // Register on Activated 
            gameWindow.Activated += OnActivated;
            gameWindow.Deactivated += OnDeactivated;
            gameWindow.InitCallback = game.InitializeBeforeRun;
            gameWindow.RunCallback = game.Tick;
            gameWindow.ExitCallback = () => OnExiting(this, EventArgs.Empty);

            var windowCreated = WindowCreated;
            if (windowCreated != null)
            {
                windowCreated(this, EventArgs.Empty);
            }

            gameWindow.Run();
        }