Axiom.Core.Root.CreateSceneManager C# (CSharp) Method

CreateSceneManager() public method

Creates a SceneManager instance based on scene type support.
Creates an instance of a SceneManager which supports the scene types identified in the parameter. If more than one type of SceneManager has been registered as handling that combination of scene types, in instance of the last one registered is returned.
public CreateSceneManager ( SceneType sceneType ) : SceneManager
sceneType SceneType A mask containing one or more flags.
return SceneManager
		public SceneManager CreateSceneManager( SceneType sceneType )
		{
			string instanceName = ( new NameGenerator<SceneManager>() ).GetNextUniqueName( sceneType.ToString() );
			return this.sceneManagerEnumerator.CreateSceneManager( sceneType, instanceName );
		}

Same methods

Root::CreateSceneManager ( SceneType sceneType, string instanceName ) : SceneManager
Root::CreateSceneManager ( string typeName ) : SceneManager
Root::CreateSceneManager ( string typeName, string instanceName ) : SceneManager

Usage Example

Beispiel #1
0
        public void Start(string host, bool userConfigure, bool debugSettings)
        {
            // HACK: Use an English culture so that Axiom.Overlays.Elements.BorderPanel works.
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

            // HACK: Get assembly Axiom.Platforms.Win32.dll loaded before any dynamically created assembly.
            // This is to avoid an exception getting thrown from the Root constructor.
            System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(Axiom.Platforms.Win32.Win32InputReader).TypeHandle);

            var service = Connect(host);
            var configuration = ConfigurationManagerFactory.CreateDefault();
            using (var root = new Root("MOOLGOSS.log"))
            using (Globals.Input = new Input())
            {
                root.RenderSystem = root.RenderSystems[0];
                root.RenderSystem.ConfigOptions["VSync"].Value = "Yes";
                root.RenderSystem.ConfigOptions["Full Screen"].Value = "Yes";
                var bestMode =
                    root.RenderSystem.ConfigOptions["Video Mode"].PossibleValues
                    .Where(x => x.Value.Contains("32-bit color"))
                    .LastOrDefault().Value;
                if (bestMode != null) root.RenderSystem.ConfigOptions["Video Mode"].Value = bestMode;
                if (debugSettings)
                {
                    root.RenderSystem.ConfigOptions["Full Screen"].Value = "No";
                    root.RenderSystem.ConfigOptions["Video Mode"].Value = "800 x 600 @ 32-bit color";
                }
                if (userConfigure && !configuration.ShowConfigDialog(root)) return;
                var window = CreateRenderWindow(root.RenderSystem.ConfigOptions["Video Mode"].Value == "Yes");
                Globals.Input.Initialize(window, ownMouse: !debugSettings);
                ResourceGroupManager.Instance.AddResourceLocation("Media", "Folder", true);
                ResourceGroupManager.Instance.InitializeAllResourceGroups();
                Globals.Scene = root.CreateSceneManager(SceneType.Generic);
                Globals.UI = new UserInterface();
                Globals.UI.AddMode(new TitleScreen());
                Globals.UI.AddMode(new Gameplay(service));
                Globals.UI.AddMode(new Docked());
                Globals.UI.SetMode("Title Screen");
                CreateCamera(window);
                root.FrameStarted += FrameStartedHandler;
                root.StartRendering();
            }
        }
All Usage Examples Of Axiom.Core.Root::CreateSceneManager