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

CreateSceneManager() public method

Creates a SceneManager instance of a given type.
You can use this method to create a SceneManager instance of a given specific type. You may know this type already, or you may have discovered it by looking at the results from Root.GetSceneManagerMetaData.
public CreateSceneManager ( string typeName ) : SceneManager
typeName string String identifying a unique SceneManager type.
return SceneManager
		public SceneManager CreateSceneManager( string typeName )
		{
			string instanceName = ( new NameGenerator<SceneManager>() ).GetNextUniqueName( typeName.ToString() );
			return this.sceneManagerEnumerator.CreateSceneManager( typeName, instanceName );
		}

Same methods

Root::CreateSceneManager ( SceneType sceneType ) : SceneManager
Root::CreateSceneManager ( SceneType sceneType, string instanceName ) : 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