Ejemplo n.º 1
0
        private void render(float delta, CrystalRenderer drawer)
        {
            Window.Clear();

            if (scenes.TryPeek(out var scene))
            {
                scene.Render(delta, drawer);

                var canvas       = new Sprite(scene.Canvas.ToSFML().Texture);
                var windowCanvas = new Sprite(scene.WindowCanvas.ToSFML().Texture);

                Window.Draw(canvas);
                Window.Draw(windowCanvas);

                Window.Display();
            }
            else
            {
                Window.Close();
            }
        }
Ejemplo n.º 2
0
        public void Run()
        {
            this.Window = new RenderWindow(new VideoMode(800, 600), config.Project);

            var clock    = new Clock();
            var input    = new CrystalInput(this.Window);
            var renderer = new CrystalRenderer();
            var content  = new ContentManager();

            this.PushScene(content.Load <Framework.Scene>(config.MainScene));

            while (Window.IsOpen)
            {
                Window.DispatchEvents();

                var delta = clock.Restart().AsSeconds();

                this.update(delta, input);
                this.render(delta, renderer);

                input.AdvanceState();
            }
        }
Ejemplo n.º 3
0
        public static byte[] RenderAsPdf(string path, CompiledReport report)
        {
            var renderer = new CrystalRenderer();

            return(renderer.Render(path, report));
        }