/// <summary>
        /// Renders a portion of the next frame.
        /// </summary>
        public override void RenderFrame()
        {
            var sb = new GlSpriteBatch(
                ActorAtlas,
                GlProgramId
                );

            // Render immobile actors
            //
            foreach (BrickActor brick in Game.GameState.Scene.ImmobileBricks)
            {
                ActorAnimationFrame currentFrame = brick.Animation.GetCurrentFrame();
                Rectanglei          blitRect     = ActorAtlas.GetSpriteUV(currentFrame.SpriteName);
                Point pointLoc = brick.Location
                                 .Product(Game.GameState.Scene.CellSize)
                                 .Add(currentFrame.Offset).Add(Origin.Product(Game.GameState.Scene.CellSize));
                Vector2i drawLoc = new Vector2i(
                    pointLoc.X, pointLoc.Y
                    );

                sb.Draw(
                    currentFrame.SpriteName,
                    new Rectanglei(
                        drawLoc,
                        blitRect.Size
                        )
                    );
            }

            sb.Finish();
        }
Beispiel #2
0
        /// <summary>
        /// Renders a portion of the next frame.
        /// </summary>
        public override void RenderFrame()
        {
            uint simpleUvProgramId = Resources.GetShaderProgram("SimpleUVs");
            var  sb = new GlSpriteBatch(
                TitleAtlas,
                simpleUvProgramId
                );

            sb.Draw(
                "neo_title",
                new Rectanglei(
                    new Vector2i(0, 0),
                    new Vector2i(
                        (int)GlRenderer.JUNKBOT_VIEWPORT.X,
                        (int)GlRenderer.JUNKBOT_VIEWPORT.Y
                        )
                    )
                );

            sb.Finish();
        }
        /// <summary>
        /// Renders a portion of the next frame.
        /// </summary>
        public override void RenderFrame()
        {
            uint simpleUvProgramId = ResourceCache.GetShaderProgram("SimpleUVs");
            var  sb = new GlSpriteBatch(
                Environment.CurrentDirectory + @"\Content\Atlas\menu-atlas.png",
                simpleUvProgramId
                );

            sb.Draw(
                "neo_title",
                new Rectanglei(
                    new Vector2i(0, 0),
                    new Vector2i(
                        (int)GlRenderer.JUNKBOT_VIEWPORT.X,
                        (int)GlRenderer.JUNKBOT_VIEWPORT.Y
                        )
                    )
                );

            sb.Finish();
            sb.Dispose();
        }