Beispiel #1
0
        public MiGame()
            : base()
        {
            graphics = new GraphicsDeviceManager(this);
            MiResolution.Init(ref graphics);

            Content.RootDirectory = "Content";

            toDraw      = new LinkedList <MiScreen>();
            toUpdate    = new Stack <MiScreen>();
            updateQueue = new Queue <MiScreen>();

            scriptEngine = new MiScriptEngine(this);
        }
Beispiel #2
0
        protected override void Draw(GameTime gameTime)
        {
            MiResolution.BeginDraw();

            SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, MiResolution.GetTransformationMatrix());

            foreach (MiScreen screen in toDraw)
            {
                screen.Draw(gameTime);
            }
#if DEBUG
            frameCounter++;
            spriteBatch.DrawString(Content.Load <SpriteFont>("Fonts\\Default"), "Frame Rate: " + frameRate + "fps", new Vector2(5, MiResolution.VirtualHeight - 25), Color.White);
#endif

            SpriteBatch.End();

            base.Draw(gameTime);
        }