Changeset 1910
- Timestamp:
- 11/20/09 15:30:51 (3 months ago)
- Author:
- borrillis
- Message:
-
- TechDemo?
Added some error checking in case Overlays weren't loaded.
- Location:
- trunk/Projects/AxiomDemos/Source/Demos
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r1843
|
r1910
|
|
| 44 | 44 | <DebugSymbols>true</DebugSymbols> |
| 45 | 45 | <OutputPath>bin\x86\</OutputPath> |
| 46 | | <DefineConstants>DEBUG;TRACE</DefineConstants> |
| | 46 | <DefineConstants>TRACE;DEBUG</DefineConstants> |
| 47 | 47 | <BaseAddress>285212672</BaseAddress> |
| 48 | 48 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
-
|
r1815
|
r1910
|
|
| 35 | 35 | public ConfigureInput SetupInput; |
| 36 | 36 | |
| 37 | | public TechDemo() { SetupInput += new ConfigureInput( _setupInput ); } |
| | 37 | public TechDemo() { SetupInput = new ConfigureInput( _setupInput ); } |
| 38 | 38 | |
| 39 | 39 | #region Protected Fields |
| … |
… |
|
| 246 | 246 | ir.Initialize( window, true, true, false, false ); |
| 247 | 247 | #endif |
| | 248 | |
| 248 | 249 | #if ( SIS ) |
| 249 | 250 | SharpInputSystem.ParameterList pl = new SharpInputSystem.ParameterList(); |
| … |
… |
|
| 589 | 590 | toggleDelay = .3f; |
| 590 | 591 | } |
| 591 | | #endif |
| 592 | 592 | #if DEBUG |
| 593 | 593 | if ( !input.IsMousePressed( MouseButtons.Left ) ) |
| … |
… |
|
| 605 | 605 | } |
| 606 | 606 | #endif |
| | 607 | #endif |
| | 608 | |
| 607 | 609 | #if ( SIS ) |
| 608 | 610 | // TODO: Move this into an event queueing mechanism that is processed every frame |
| … |
… |
|
| 783 | 785 | } |
| 784 | 786 | |
| 785 | | OverlayElement element = OverlayManager.Instance.Elements.GetElement( "Core/DebugText" ); |
| 786 | | element.Text = debugText; |
| | 787 | if ( debugText != String.Empty ) |
| | 788 | { |
| | 789 | OverlayElement element = OverlayManager.Instance.Elements.GetElement( "Core/DebugText" ); |
| | 790 | element.Text = debugText; |
| | 791 | } |
| 787 | 792 | } |
| 788 | 793 | |
| … |
… |
|
| 795 | 800 | // TODO: Replace with CEGUI |
| 796 | 801 | OverlayElement element = OverlayManager.Instance.Elements.GetElement( "Core/CurrFps" ); |
| | 802 | if ( element != null ) |
| 797 | 803 | element.Text = string.Format( "Current FPS: {0:#.00}", Root.Instance.CurrentFPS ); |
| 798 | 804 | |
| 799 | 805 | element = OverlayManager.Instance.Elements.GetElement( "Core/BestFps" ); |
| 800 | | element.Text = string.Format( "Best FPS: {0:#.00}", Root.Instance.BestFPS ); |
| | 806 | if ( element != null ) |
| | 807 | element.Text = string.Format( "Best FPS: {0:#.00}", Root.Instance.BestFPS ); |
| 801 | 808 | |
| 802 | 809 | element = OverlayManager.Instance.Elements.GetElement( "Core/WorstFps" ); |
| 803 | | element.Text = string.Format( "Worst FPS: {0:#.00}", Root.Instance.WorstFPS ); |
| | 810 | if ( element != null ) |
| | 811 | element.Text = string.Format( "Worst FPS: {0:#.00}", Root.Instance.WorstFPS ); |
| 804 | 812 | |
| 805 | 813 | //element = OverlayManager.Instance.Elements.GetElement( "Core/AverageFps" ); |
| … |
… |
|
| 810 | 818 | average = sum / elapsedFrames; |
| 811 | 819 | elapsedFrames++; |
| 812 | | element.Text = string.Format( "Average FPS: {0:#.00} in {1:#.0}s", average, ( DateTime.Now - averageStart ).TotalSeconds ); |
| | 820 | if ( element != null ) |
| | 821 | element.Text = string.Format( "Average FPS: {0:#.00} in {1:#.0}s", average, ( DateTime.Now - averageStart ).TotalSeconds ); |
| 813 | 822 | |
| 814 | 823 | element = OverlayManager.Instance.Elements.GetElement( "Core/NumTris" ); |
| 815 | | element.Text = string.Format( "Triangle Count: {0}", scene.TargetRenderSystem.FacesRendered ); |
| | 824 | if ( element != null ) |
| | 825 | element.Text = string.Format( "Triangle Count: {0}", scene.TargetRenderSystem.FacesRendered ); |
| 816 | 826 | |
| 817 | 827 | element = OverlayManager.Instance.Elements.GetElement("Core/NumBatches"); |
| 818 | | element.Text = string.Format("Batch Count: {0}", scene.TargetRenderSystem.BatchesRendered); |
| | 828 | if ( element != null ) |
| | 829 | element.Text = string.Format( "Batch Count: {0}", scene.TargetRenderSystem.BatchesRendered ); |
| 819 | 830 | } |
| 820 | 831 | |
Download in other formats: