コード例 #1
0
        public void TestShowcaseSingleFrame()
        {
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
            var game = createGame();

            game.SpectaterCamera = loadCamera(ShowcaseCamera);
            game.Camera          = game.SpectaterCamera;

            var renderer = new DeferredRenderer(game);

            var showcase = new ShowcaseSceneBuilder();

            showcase.CreateScene(renderer);

            game.GameLoopEvent += delegate
            {
                renderer.Draw();
                game.Exit();
            };

            game.Run();
        }
コード例 #2
0
        public void TestCompleteShowcase()
        {
            var game = createGame();

            var renderer = new DeferredRenderer(game);

            var showcase = new ShowcaseSceneBuilder();

            showcase.CreateScene(renderer);

            game.GameLoopEvent += g =>
            {
                renderer.Draw();
                if (game.Keyboard.IsKeyDown(Key.C))
                {
                    var s = createCameraSerializer();
                    using (var fs = File.OpenWrite("camera.xml"))
                        s.Serialize(fs, game.SpectaterCamera);
                }
            };

            game.Run();
        }