You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
107 lines
2.5 KiB
C++
107 lines
2.5 KiB
C++
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "Slate.h"
|
|
#include "RealtimeProfiler.h"
|
|
#include "SRealtimeProfilerFrame.h"
|
|
#include "SRealtimeProfilerVisualizer.h"
|
|
|
|
#include "TaskGraphInterfaces.h"
|
|
#include "STaskGraph.h"
|
|
#include "SGraphBar.h"
|
|
#include "SBarVisualizer.h"
|
|
#include "SEventsTree.h"
|
|
|
|
|
|
/*
|
|
void SRealtimeProfilerFrame::Construct( const FArguments& InArgs )
|
|
{
|
|
TSharedPtr<SDockNode> InitialContent;
|
|
InitialContent = SAssignNew( PrimaryTabStack, SDockTabStack ).IsDocumentArea(true);
|
|
|
|
ChildSlot
|
|
[
|
|
SAssignNew( MainDockArea, SDockArea )
|
|
.InitialContent
|
|
(
|
|
InitialContent
|
|
)
|
|
.InlineContentLeft
|
|
(
|
|
SNew(SVerticalBox)
|
|
+SVerticalBox::Slot()
|
|
.FillHeight(1)
|
|
.VAlign(VAlign_Center)
|
|
[
|
|
MakeMainMenu()
|
|
]
|
|
)
|
|
];
|
|
|
|
// Create initial layout
|
|
AddVisualizer( NULL );
|
|
}
|
|
|
|
bool SRealtimeProfilerFrame::IsProfiling()
|
|
{
|
|
return Visualizer->IsProfiling();
|
|
}
|
|
|
|
|
|
TSharedRef< SWidget > SRealtimeProfilerFrame::MakeMainMenu()
|
|
{
|
|
FMenuBarBuilder MenuBuilder( NULL );
|
|
|
|
// Create the menu bar
|
|
TSharedRef< SWidget > MenuBarWidget = MenuBuilder.MakeWidget();
|
|
|
|
return MenuBarWidget;
|
|
}
|
|
|
|
void SRealtimeProfilerFrame::AddVisualizer( TSharedPtr< SDockTabStack > TabStack )
|
|
{
|
|
TSharedRef<SRealtimeProfilerVisualizer> NewVisualizer = SNew( SRealtimeProfilerVisualizer );
|
|
|
|
Visualizers.Add( NewVisualizer );
|
|
|
|
AddTab( NewVisualizer, "Stats", NSLOCTEXT("TaskGraph", "ProfileVisualizerToolTip", "Profile Visualizer.").ToString(), TabStack );
|
|
|
|
|
|
Visualizer = NewVisualizer;
|
|
}
|
|
|
|
void SRealtimeProfilerFrame::Update(TSharedPtr< FVisualizerEvent > InProfileData, FRealtimeProfilerFPSChartFrame * InFPSChartFrame)
|
|
{
|
|
Visualizer->Update(InProfileData,InFPSChartFrame);
|
|
}
|
|
|
|
void SRealtimeProfilerFrame::AddTab( TSharedRef<SWidget> InTabContents, TAttribute< FString > InLabel, const FString& InTooltipText, TSharedPtr< SDockTabStack > TabStack )
|
|
{
|
|
TSharedRef<SDockableTab> NewDockTab = SNew( SDockableTab )
|
|
.TabRole( ETabRole::MajorTab )
|
|
.Label( InLabel )
|
|
.ToolTipText( InTooltipText )
|
|
.OnTabClosed( SDockableTab::FOnTabClosedCallback::CreateSP( this, &SRealtimeProfilerFrame::OnTabClosed, InTabContents ) )
|
|
[
|
|
InTabContents
|
|
];
|
|
|
|
if( TabStack.IsValid() == false )
|
|
{
|
|
TabStack = PrimaryTabStack;
|
|
}
|
|
|
|
TabStack->AddTab( NewDockTab );
|
|
}
|
|
|
|
void SRealtimeProfilerFrame::OnTabClosed( TSharedRef<SDockableTab> ClosedTab, TSharedRef<SWidget> ClosedTabContents )
|
|
{
|
|
for( int32 Index = 0; Index < Visualizers.Num(); Index++ )
|
|
{
|
|
if( Visualizers[ Index ] == ClosedTabContents )
|
|
{
|
|
Visualizers.RemoveAt( Index );
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
*/ |