OpenBve.Screen.Initialize C# (CSharp) Méthode

Initialize() static private méthode

Initializes the default values of the screen.
static private Initialize ( ) : void
Résultat void
		internal static void Initialize()
		{
            // --- video mode ---
            Width = Interface.CurrentOptions.FullscreenMode ? Interface.CurrentOptions.FullscreenWidth : Interface.CurrentOptions.WindowWidth;
            Height = Interface.CurrentOptions.FullscreenMode ? Interface.CurrentOptions.FullscreenHeight : Interface.CurrentOptions.WindowHeight;
            Fullscreen = Interface.CurrentOptions.FullscreenMode;
		}
		

Usage Example

Exemple #1
0
        /// <summary>Initializes the program. A matching call to deinitialize must be made when the program is terminated.</summary>
        /// <returns>Whether the initialization was successful.</returns>
        private static bool Initialize()
        {
            if (!Plugins.LoadPlugins())
            {
                return(false);
            }
            if (!Screen.Initialize())
            {
                MessageBox.Show("SDL failed to initialize the video subsystem.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return(false);
            }
            if (!Joysticks.Initialize())
            {
                MessageBox.Show("SDL failed to initialize the joystick subsystem.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return(false);
            }
            Sounds.Initialize();
            // begin HACK //
            const double degrees = 0.0174532925199433;

            World.VerticalViewingAngle         = 45.0 * degrees;
            World.HorizontalViewingAngle       = 2.0 * Math.Atan(Math.Tan(0.5 * World.VerticalViewingAngle) * World.AspectRatio);
            World.OriginalVerticalViewingAngle = World.VerticalViewingAngle;
            World.ExtraViewingDistance         = 50.0;
            World.ForwardViewingDistance       = (double)Interface.CurrentOptions.ViewingDistance;
            World.BackwardViewingDistance      = 0.0;
            World.BackgroundImageDistance      = (double)Interface.CurrentOptions.ViewingDistance;
            // end HACK //
            ClearLogFile();
            return(true);
        }
All Usage Examples Of OpenBve.Screen::Initialize