public static ResourceBackgroundQueue getSingleton()
        {
            ResourceBackgroundQueue ret = new ResourceBackgroundQueue(OgrePINVOKE.ResourceBackgroundQueue_getSingleton(), false);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ResourceBackgroundQueue obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Пример #3
0
		/// <summary>
		///     Constructor.
		/// </summary>
		/// <remarks>
		///     This public contructor is intended for the user to decide when the Root object gets instantiated.
		///     This is a critical step in preparing the engine for use.
		/// </remarks>
		/// <param name="logFilename">Name of the default log file.</param>
		public Root( string logFilename )
		{
			if ( instance == null )
			{
				instance = this;

				var info = new StringBuilder();

				// write the initial info at the top of the log
				info.AppendFormat( "*********Axiom 3D Engine Log *************\n" );
				info.AppendFormat( "{0}\n", Copyright );
                info.AppendFormat("Version: {0}\n", Version);
				info.AppendFormat( "Operating System: {0}\n", Environment.OSVersion.ToString() );
				var isMono = Type.GetType( "Mono.Runtime" ) != null;
				info.AppendFormat( "{1} Framework: {0}\n", Environment.Version.ToString(), isMono ? "Mono" : ".Net" );

				// Initializes the Log Manager singleton
				if ( LogManager.Instance == null )
				{
					new LogManager();
				}

				this.logMgr = LogManager.Instance;

				//if logFileName is null, then just the Diagnostics (debug) writes will be made
				// create a new default log
				this.logMgr.CreateLog( logFilename, true, true );

				this.logMgr.Write( info.ToString() );
				this.logMgr.Write( "*-*-* Axiom Initializing" );

				new PlatformManager();

				ArchiveManager.Instance.Initialize();
#if !SILVERLIGHT
				ArchiveManager.Instance.AddArchiveFactory( new ZipArchiveFactory() );
#endif
				ArchiveManager.Instance.AddArchiveFactory( new FileSystemArchiveFactory() );

				new ResourceGroupManager();
				new CodecManager();
				new HighLevelGpuProgramManager();

				// Register image codecs
				DDSCodec.Initialize();
				PVRTCCodec.Initialize();

				ResourceGroupManager.Instance.Initialize();

				// WorkQueue (note: users can replace this if they want)
				var defaultQ = new DefaultWorkQueue( "Root" );
				// never process responses in main thread for longer than 10ms by default
				defaultQ.ResponseProcessingTimeLimit = 10;

#if AXIOM_THREAD_SUPPORT

#if !WINDOWS_PHONE
				defaultQ.WorkerThreadCount = Environment.ProcessorCount;
#endif
				// only allow workers to access rendersystem if threadsupport is 1
				if ( Axiom.Configuration.Config.AxiomThreadLevel == 1 )
					defaultQ.WorkersCanAccessRenderSystem = true;
				else
					defaultQ.WorkersCanAccessRenderSystem = false;
#endif
				this._workQueue = defaultQ;

				var resBack = new ResourceBackgroundQueue();

				this.sceneManagerEnumerator = SceneManagerEnumerator.Instance;

				var mat = MaterialManager.Instance;
				var mesh = MeshManager.Instance;
				SkeletonManager.Instance.Initialize();
				new ParticleSystemManager();

				// create a new timer
				this.timer = new Timer();

				FontManager.Instance.Initialize();

				OverlayManager.Instance.Initialize();
				new OverlayElementManager();

				CompositorManager.Instance.Initialize();

				LodStrategyManager.Instance.Initialize();

				ScriptCompilerManager.Instance.Initialize();

				new PluginManager();
				PluginManager.Instance.LoadAll();

				// instantiate and register base movable factories
				this.entityFactory = new EntityFactory();
				AddMovableObjectFactory( this.entityFactory, true );
				this.lightFactory = new LightFactory();
				AddMovableObjectFactory( this.lightFactory, true );
				this.billboardSetFactory = new BillboardSetFactory();
				AddMovableObjectFactory( this.billboardSetFactory, true );
				this.manualObjectFactory = new ManualObjectFactory();
				AddMovableObjectFactory( this.manualObjectFactory, true );
				this.billboardChainFactory = new BillboardChainFactory();
				AddMovableObjectFactory( this.billboardChainFactory, true );
				this.ribbonTrailFactory = new RibbonTrailFactory();
				AddMovableObjectFactory( this.ribbonTrailFactory, true );
				this.movableTextFactory = new MovableTextFactory();
				AddMovableObjectFactory( this.movableTextFactory, true );
			}
		}