private static ScreenResolution CreateResolution(ScreenResolutionName resolutionName)
        {
            switch (resolutionName)
            {
            case (ScreenResolutionName.SVGA):
                return(new ScreenResolution()
                {
                    Name = ScreenResolutionName.SVGA, height = 600, width = 800
                });

            case (ScreenResolutionName.WUXGA):
                return(new ScreenResolution()
                {
                    Name = ScreenResolutionName.WUXGA, height = 1080, width = 1920
                });

            case (ScreenResolutionName.WXGA):
                return(new ScreenResolution()
                {
                    Name = ScreenResolutionName.WXGA, height = 720, width = 1280
                });


            default:
                return(new ScreenResolution()
                {
                    Name = ScreenResolutionName.SVGA, height = 600, width = 800
                });
            }
        }
Example #2
0
 public static void Startup(Game game, ContentManager content, ScreenResolutionName screenRes, DepthFormat preferreDepthFormat, bool isFixedTimeStep, bool physicsOnBackgroundThread)
 {
     SystemCore.GraphicsDeviceManager = GraphicsDeviceSetup.SetupDisplay(game, screenRes, false, preferreDepthFormat, isFixedTimeStep);;
     SystemCore.ContentManager        = content;
     SystemCore.Game = game;
     SystemCore.PhysicsOnBackgroundThread = physicsOnBackgroundThread;
     cameras = new Dictionary <string, ICamera>();
 }
Example #3
0
 public MonoEngineGame(Type startScreenType, ScreenResolutionName resolution, DepthFormat preferreDepthFormat, bool isFixedTimeStep, bool physicsOnBackgroundThread)
     : base()
 {
     this.startScreenType  = startScreenType;
     Content.RootDirectory = "Content";
     SystemCore.Startup(this, Content, resolution, preferreDepthFormat, isFixedTimeStep, physicsOnBackgroundThread);
     SystemCore.CursorVisible = true;
 }
Example #4
0
        static void Main(string[] args)
        {
            SystemCore.ActiveColorScheme = ColorScheme.ColorSchemes["elgray"];
            ScreenResolutionName resToUse = ScreenResolutionName.WXGA;

            if (System.Environment.MachineName == "NICKMCCREA-PC")
            {
                resToUse = ScreenResolutionName.WUXGA;
            }

            using (var game = new MonoEngineGame(typeof(MainMenuScreen), resToUse, DepthFormat.Depth24, true, false))
                game.Run();
        }
Example #5
0
        static void Main()
        {
            SystemCore.ActiveColorScheme = ColorScheme.ColorSchemes["space"];

            ScreenResolutionName resToUse = ScreenResolutionName.WXGA;

            if (System.Environment.MachineName == "NICKMCCREA-PC")
            {
                resToUse = ScreenResolutionName.WUXGA;
            }

            using (var game = new MonoEngineGame(typeof(MainMenuScreen), resToUse, DepthFormat.Depth24, SystemWarGlobalSettings.FixedTimeStep, SystemWarGlobalSettings.PhysicsOnBackgroundThread))
                game.Run();
        }
        public static GraphicsDeviceManager SetupDisplay(Game game, ScreenResolutionName resolutionName, bool fullScreen, DepthFormat preferreDepthFormat, bool fixedTimeStep)
        {
            GraphicsDeviceManager gd = new GraphicsDeviceManager(game);
            var resolution           = CreateResolution(resolutionName);

            gd.PreferredBackBufferHeight = resolution.height;
            gd.PreferredBackBufferWidth  = resolution.width;
            gd.PreferMultiSampling       = true;

            if (!fixedTimeStep)
            {
                gd.SynchronizeWithVerticalRetrace = false;
                game.IsFixedTimeStep = false;
            }

            gd.IsFullScreen    = fullScreen;
            gd.GraphicsProfile = GraphicsProfile.HiDef;
            return(gd);
        }