Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
memorypanel.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
12
//------------------------------------------------------------------------------
13
#if WITH_NEBULA_EDITOR
14
#include "
foundation/stdneb.h
"
15
#include "imgui.h"
16
#include "
nsharp/memoryprofile.h
"
17
#include "neweditor/core/editorpanel.h"
18
#include "
util/array.h
"
19
#include "
util/string.h
"
20
21
namespace
Scripting
22
{
23
24
//------------------------------------------------------------------------------
27
class
MemoryProfilerPanel
final :
public
Editor::EditorPanel
28
{
29
__DeclareClass
(
MemoryProfilerPanel
)
30
public
:
31
MemoryProfilerPanel
();
32
virtual
~MemoryProfilerPanel
();
33
34
bool
BeginWindow()
override
;
35
void
Draw()
override
;
36
37
protected
:
38
bool
OnSetup()
override
;
39
40
private
:
42
void
ReadSample();
43
45
void
Append(
Util::Array<float>
& history,
float
value);
46
48
void
DrawGraph(
const
char
* label,
const
char
*
id
,
const
Util::Array<float>
& values,
const
ImVec4& color,
bool
asBars,
const
Util::String
& overlay);
49
51
void
DrawBar(
const
char
* label, uint64_t value, uint64_t budget);
52
54
void
DrawGenerations();
55
57
void
CommandCollect(
const
Util::Array<Util::String>
& args);
58
59
bool
pauseProfiling;
60
62
bool
sampled;
63
MemoryProfile::Sample sample;
64
uint64_t prevTotalAllocated;
65
double
prevTotalPauseMs;
66
int
prevCollections;
67
69
uint64_t frameAllocated;
70
double
framePauseMs;
71
int
collectionsThisFrame;
72
74
float
heapBudgetMb;
75
float
frameAllocBudgetKb;
76
78
static
const
IndexT
MaxHistory = 240;
79
Util::Array<float>
allocatedHistory;
80
Util::Array<float>
frameAllocHistory;
81
Util::Array<float>
pauseHistory;
83
Util::Array<int>
collectionHistory;
84
};
85
86
}
// namespace Scripting
87
88
#endif
// WITH_NEBULA_EDITOR
89
//------------------------------------------------------------------------------
array.h
MemoryProfilerPanel
Util::Array
Nebula's dynamic array class.
Definition
array.h:61
Util::String
Nebula's universal string class.
Definition
string.h:50
stdneb.h
memoryprofile.h
Scripting
Definition
game.cc:16
__DeclareClass
#define __DeclareClass(type)
string.h
IndexT
int IndexT
Definition
types.h:49
code
addons
nsharp
editor
memorypanel.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.