/// <summary> /// Extendeded to setup a default tray interface and camera controller. /// </summary> /// <param name="window"></param> /// <param name="keyboard"></param> /// <param name="mouse"></param> protected internal override void Setup(RenderWindow window, SIS.Keyboard keyboard, SIS.Mouse mouse) { Window = window; Keyboard = keyboard; Mouse = mouse; LocateResources(); CreateSceneManager(); SetupView(); this.TrayManager = new SdkTrayManager("SampleControls", window, mouse, this as ISdkTrayListener); // create a tray interface LoadResources(); ResourcesLoaded = true; // Show stats and logo and Hide the cursor this.TrayManager.ShowFrameStats(TrayLocation.BottomLeft); this.TrayManager.ShowLogo(TrayLocation.BottomRight); this.TrayManager.HideCursor(); // create a params panel for displaying sample details var items = new List <string> { "cam.pX", "cam.pY", "cam.pZ", String.Empty, "cam.oW", "cam.oX", "cam.oY", "cam.oZ", String.Empty, "Filtering", "Poly Mode" }; this.DetailsPanel = this.TrayManager.CreateParamsPanel(TrayLocation.None, "DetailsPanel", 180, items); this.DetailsPanel.SetParamValue(9, "Bilinear"); this.DetailsPanel.SetParamValue(10, "Solid"); this.DetailsPanel.Hide(); SetupContent(); ContentSetup = true; IsDone = false; }
/// <summary> /// Extendeded to setup a default tray interface and camera controller. /// </summary> /// <param name="window"></param> /// <param name="keyboard"></param> /// <param name="mouse"></param> protected internal override void Setup( RenderWindow window, SIS.Keyboard keyboard, SIS.Mouse mouse ) { Window = window; Keyboard = keyboard; Mouse = mouse; LocateResources(); CreateSceneManager(); SetupView(); this.TrayManager = new SdkTrayManager( "SampleControls", window, mouse, this as ISdkTrayListener ); // create a tray interface LoadResources(); ResourcesLoaded = true; // Show stats and logo and Hide the cursor this.TrayManager.ShowFrameStats( TrayLocation.BottomLeft ); this.TrayManager.ShowLogo( TrayLocation.BottomRight ); this.TrayManager.HideCursor(); // create a params panel for displaying sample details List<string> items = new List<string> { "cam.pX", "cam.pY", "cam.pZ", String.Empty, "cam.oW", "cam.oX", "cam.oY", "cam.oZ", String.Empty, "Filtering", "Poly Mode" }; this.DetailsPanel = this.TrayManager.CreateParamsPanel( TrayLocation.None, "DetailsPanel", 180, items ); this.DetailsPanel.SetParamValue( 9, "Bilinear" ); this.DetailsPanel.SetParamValue( 10, "Solid" ); this.DetailsPanel.Hide(); SetupContent(); ContentSetup = true; IsDone = false; }
/// <summary> /// Destroys a widget. /// </summary> /// <param name="widget"></param> public void DestroyWidget( Widget widget ) { if ( widget == null ) { new AxiomException( "Widget does not exist,TrayManager.DestroyWidget" ); } // in case special widgets are destroyed manually, set them to 0 if ( widget == this.Logo ) { this.Logo = null; } else if ( widget == this.StatsPanel ) { this.StatsPanel = null; } else if ( widget == this.mFpsLabel ) { this.mFpsLabel = null; } this.mTrays[ (int)widget.TrayLocation ].RemoveChild( widget.Name ); WidgetList wList = this.mWidgets[ (int)widget.TrayLocation ]; wList.Remove( widget ); if ( widget == ExpandedMenu ) { ExpandedMenu = null; } widget.Cleanup(); this.mWidgetDeathRow.Add( widget ); AdjustTrays(); }
/// <summary> /// Hides frame statistics widget set. /// </summary> public void HideFrameStats() { if ( IsFrameStatsVisible ) { DestroyWidget( this.mFpsLabel ); DestroyWidget( this.StatsPanel ); this.mFpsLabel = null; this.StatsPanel = null; } }
/// <summary> /// Shows frame statistics widget set in the specified location. /// </summary> /// <param name="trayLoc"></param> /// <param name="place"></param> public void ShowFrameStats( TrayLocation trayLoc, int place ) { if ( !IsFrameStatsVisible ) { var stats = new List<string>(); stats.Add( "Average FPS" ); stats.Add( "Best FPS" ); stats.Add( "Worst FPS" ); stats.Add( "Triangles" ); stats.Add( "Batches" ); this.mFpsLabel = CreateLabel( TrayLocation.None, this.mName + "/FpsLabel", "FPS:", 180 ); this.mFpsLabel.AssignedTrayListener = this; this.StatsPanel = CreateParamsPanel( TrayLocation.None, this.mName + "/StatsPanel", 180, stats ); } MoveWidgetToTray( this.mFpsLabel, trayLoc, place ); MoveWidgetToTray( this.StatsPanel, trayLoc, LocateWidgetInTray( this.mFpsLabel ) + 1 ); }
/// <summary> /// /// </summary> /// <param name="trayLoc"></param> /// <param name="name"></param> /// <param name="width"></param> /// <param name="paramNames"></param> /// <returns></returns> public ParamsPanel CreateParamsPanel( TrayLocation trayLoc, String name, Real width, IList<String> paramNames ) { var pp = new ParamsPanel( name, width, paramNames.Count ); pp.ParamNames = paramNames; MoveWidgetToTray( pp, trayLoc ); return pp; }
/// <summary> /// /// </summary> /// <param name="trayLoc"></param> /// <param name="name"></param> /// <param name="width"></param> /// <param name="lines"></param> /// <returns></returns> public ParamsPanel CreateParamsPanel( TrayLocation trayLoc, String name, Real width, int lines ) { var pp = new ParamsPanel( name, width, lines ); MoveWidgetToTray( pp, trayLoc ); return pp; }
/// <summary> /// Hides frame statistics widget set. /// </summary> public void HideFrameStats() { if ( IsFrameStatsVisible ) { DestroyWidget( mFpsLabel ); DestroyWidget( StatsPanel ); mFpsLabel = null; StatsPanel = null; } }