コード例 #1
0
        protected override async Task OnInitialization()
        {
            await base.OnInitialization();

            Resolutions = AsyncObservableCollection <Resolution> .Create(Resolution.CommonResolutions);

            Resolutions.SelectedItem = Resolutions.First();
        }
コード例 #2
0
        /// <summary>
        /// Called after all framework resources have been initialized and allocated.
        /// </summary>
        /// <remarks>
        /// Before <see cref="Initialize"/> is called, MonoGame will not have set up the <see cref="Microsoft.Xna.Framework.Graphics.GraphicsDevice"/> yet, preventing <see cref="Komodo.Core.Engine.Graphics.Texture"/> or <see cref="Komodo.Core.Engine.Graphics.Model"/> from being generated.
        /// </remarks>
        public void Initialize()
        {
            SpriteBatch = new SpriteBatch(GraphicsDeviceManager.GraphicsDevice);

            var resolution = Resolutions.First();

            if (Resolutions.Count > 3)
            {
                resolution = Resolutions[3];
            }
            SetResolution(resolution);
            SetFullscreen(false);
        }