Chroma - drawing to a texture

The Setup

This example follows the setup from this entry.

The Execution
using Chroma;
using Chroma.Graphics;
using System.Numerics;

namespace Example
{
    internal class GameCore : Game
    {
        private RenderTarget _target;

        public GameCore()
        {
            Window.GoWindowed(1024, 600);
        }

        protected override void LoadContent()
        {
            _target = new RenderTarget(
                (ushort)Window.Properties.Width,
                (ushort)Window.Properties.Height
            );
        }

        protected override void Draw(RenderContext context)
        {
            context.RenderTo(_target, () => {
                // nesting RenderTo calls will have an undefined
                // behavior at the time of writing (release 0.5, 23-05-2020)

                context.Rectangle(
                    ShapeMode.Fill,
                    new Vector2(200, 200),
                    100,
                    100,
                    Color.White
                );
            });

            context.DrawTexture(
                _target, 
                Vector2.Zero,
                Vector2.One,
                Vector2.Zero,
                0
            );
        }
    }
}