Esempio n. 1
0
        // Executes one step (frame) of the game, both logic and drawing. The parameter is time
        // since last frame, but it isn't actually used except in the tick event. No one uses it
        // there either.
        private bool Step(float dt)
        {
            CheckInput();

            GameTickEventArgs e = new GameTickEventArgs(dt);

            if (GameLogicTick != null)
            {
                GameLogicTick(e);                           // this one is for more basic operations
            }
            // render phase
            GameRenderEventArgs r = new GameRenderEventArgs(renderContext);

            GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Green);

            if (GameRenderBegin != null)
            {
                GameRenderBegin(r);
            }

            renderContext.SetOpacity(opacity);
            renderContext.Begin();

            if (GameRender != null)
            {
                GameRender(r);
            }

            renderContext.End();

            if (GameRenderEnd != null)
            {
                GameRenderEnd(r);
            }

            return(false);
        }