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

StartRendering() public method

Starts the default rendering loop.
public StartRendering ( ) : void
return void
		public void StartRendering()
		{
			Debug.Assert( this.activeRenderSystem != null, "Engine cannot start rendering without an active RenderSystem." );

			this.activeRenderSystem.InitRenderTargets();

			// initialize the vars
			this.lastStartTime = this.lastQueuedTime = this.lastEndTime = this.timer.Milliseconds;

			// reset to false so that rendering can begin
			this.queuedEnd = false;

			while ( !this.queuedEnd )
			{
				// allow OS events to process (if the platform requires it
				if ( WindowEventMonitor.Instance.MessagePump != null )
				{
					WindowEventMonitor.Instance.MessagePump();
				}

				if ( !this.RenderOneFrame() )
				{
					break;
				}
			}
		}

Usage Example

Beispiel #1
0
		static void Main(string[] args)
		{
			IConfigurationManager ConfigurationManager = ConfigurationManagerFactory.CreateDefault();
			using (Root _root = new Root("game.log"))
			{
				ConfigurationManager.RestoreConfiguration(_root);
				if (ConfigurationManager.ShowConfigDialog(_root))
				{
					ConfigurationManager.SaveConfiguration(_root);

					using (RenderWindow _renderWindow = _root.Initialize(true, "Illisian.Niva"))
					{

						var game = new Game(_root, _renderWindow);
						WindowEventMonitor.Instance.RegisterListener(_renderWindow, game);
						game.OnLoad();
						game.CreateScene();
						_root.FrameRenderingQueued += game.OnRenderFrame;
						_root.FrameStarted += game.UpdateInput;
						_root.FrameStarted += game.UpdateOverlay;
						_root.FrameEnded += game.OnRenderFrameEnd;
						_root.StartRendering();

						game.OnUnload();
					}
				}

			}
		}
All Usage Examples Of Axiom.Core.Root::StartRendering