Exemple #1
0
        static void Main(string[] args)
        {
            var config = new App.Config
            {
                LibraryConfig = { FileStores                           = { new RootDirectoryFileStoreConfig {
                                                                               RootDirectoryPath = "../../Assets"
                                                                           } } },
                RendererConfig = { ClearColor = Color.Indigo },

                LoggerConfig =
                {
                    IncludeCallingMethod = true,
                    Endpoints            = { new ConsoleEndpoint.Config() }
                },

                WindowConfig =
                {
                    WindowSize = new Size {
                        Width  = 640, Height = 480
                    }
                }
            };

            var app = new App(config);

            app.Run(firstSpace: new TestSpace());
        }
Exemple #2
0
 internal Window(App.Config appConfig, XnaGame xnaGame)
 {
     XnaGame     = xnaGame;
     AllowResize = appConfig.WindowConfig.AllowResize;
     ShowCursor  = appConfig.WindowConfig.ShowCursor;
     size        = appConfig.WindowConfig.WindowSize;
     xnaGame.Window.ClientSizeChanged += Window_ClientSizeChanged;
 }
Exemple #3
0
        public XnaGame(App app, App.Config config)
        {
            App       = app;
            AppConfig = config;

            var res = config.RendererConfig.InternalResolution ?? config.WindowConfig.WindowSize;

            Graphics = new GraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth       = (int)res.Width,
                PreferredBackBufferHeight      = (int)res.Height,
                SynchronizeWithVerticalRetrace = config.RendererConfig.VSync
            };

            Renderer = new Renderer(config.RendererConfig, this);

            Window.AllowUserResizing = config.WindowConfig.AllowResize;
            IsMouseVisible           = config.WindowConfig.ShowCursor;
        }