Ejemplo n.º 1
0
        public void InitializeSystem()
        {
            configManager              = new Config.DefaultConfigurationManager();
            root                       = new Root(configManager.LogFilename);
            root.FrameRenderingQueued += RootFrameRenderingQueued;

            // Load Config.
            configManager.RestoreConfiguration(root);

            // Render System.
            if (root.RenderSystem == null)
            {
                renderSystem = root.RenderSystem = root.RenderSystems.First().Value;
            }
            else
            {
                renderSystem = root.RenderSystem;
            }

            // Render Window.
            Root.Instance.Initialize(false);
            var parameterList = new NamedParameterList
            {
                { "vsync", "true" },
                { "Anti aliasing", "Level 2" },
                { "FSAA", 1 },
                { "colorDepth", 32 },
                { "border", "fixed" }
            };

            window = Root.Instance.CreateRenderWindow("EvolutionWarWindow", Constants.Width, Constants.Height, false, parameterList);
            WindowEventMonitor.Instance.RegisterListener(window, this);

            // Content.
            Constants.Load();
            ResourceGroupManager.Instance.AddResourceLocation("Meshes", "Folder", true);
            ResourceGroupManager.Instance.AddResourceLocation("Fonts", "Folder", true);
            ResourceGroupManager.Instance.InitializeAllResourceGroups();

            // Fonts.
            var font = FontManager.Instance.Create("Candara", ResourceGroupManager.DefaultResourceGroupName) as Font;

            if (font != null)
            {
                font.Type               = FontType.TrueType;
                font.Source             = "Candarab.ttf";
                font.TrueTypeSize       = 36;
                font.TrueTypeResolution = 96;
                font.AntialiasColor     = false;
                font.Load();
            }

            // Scene Manager.
            sceneManager = root.CreateSceneManager("DefaultSceneManager", "GameSMInstance");
            sceneManager.ClearScene();
        }
Ejemplo n.º 2
0
        public void InitializeSystem()
        {
            configManager = new Config.DefaultConfigurationManager();
            root = new Root(configManager.LogFilename);
            root.FrameRenderingQueued += RootFrameRenderingQueued;

            // Load Config.
            configManager.RestoreConfiguration(root);

            // Render System.
            if (root.RenderSystem == null)
                renderSystem = root.RenderSystem = root.RenderSystems.First().Value;
            else
                renderSystem = root.RenderSystem;

            // Render Window.
            Root.Instance.Initialize(false);
            var parameterList = new NamedParameterList
            {
                {"vsync", "true"},
                {"Anti aliasing", "Level 2"},
                {"FSAA", 1},
                {"colorDepth", 32},
                {"border", "fixed"}
            };
            window = Root.Instance.CreateRenderWindow("EvolutionWarWindow", Constants.Width, Constants.Height, false, parameterList);
            WindowEventMonitor.Instance.RegisterListener(window, this);

            // Content.
            Constants.Load();
            ResourceGroupManager.Instance.AddResourceLocation("Meshes", "Folder", true);
            ResourceGroupManager.Instance.AddResourceLocation("Fonts", "Folder", true);
            ResourceGroupManager.Instance.InitializeAllResourceGroups();

            // Fonts.
            var font = FontManager.Instance.Create("Candara", ResourceGroupManager.DefaultResourceGroupName) as Font;
            if (font != null)
            {
                font.Type = FontType.TrueType;
                font.Source = "Candarab.ttf";
                font.TrueTypeSize = 36;
                font.TrueTypeResolution = 96;
                font.AntialiasColor = false;
                font.Load();
            }

            // Scene Manager.
            sceneManager = root.CreateSceneManager("DefaultSceneManager", "GameSMInstance");
            sceneManager.ClearScene();
        }