Rise
The Vieneo Province
Toggle main menu visibility
Loading...
Searching...
No Matches
Page.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
../Instruments/Instrument.h
"
4
#include "
Element.h
"
5
6
class
Page
7
{
8
public
:
9
std::string
name
;
10
std::vector<Instrument*>
instruments
;
11
std::vector<Element>
elements
;
12
13
void
Render
()
14
{
15
Rendering::ProfileCpuScope11
pageTiming(
"Page"
,
name
.c_str());
16
for
(UINT i = 0; i <
instruments
.size(); i++)
17
{
18
Rendering::ProfileCpuScope11
instrumentTiming(
instruments
.at(i)->profileName.c_str());
19
instruments
.at(i)->Render();
20
}
21
for
(UINT i = 0; i <
elements
.size(); i++)
22
elements
.at(i).Render();
23
}
24
25
~Page
()
26
{
27
instruments
.clear();
28
}
29
30
bool
HandleKeyPress
(
short
key,
bool
shift)
31
{
32
for
(UINT i = 0; i <
instruments
.size(); i++)
33
{
34
if
(
instruments
.at(i)->HandleKeyPress(key, shift))
35
return
true
;
36
}
37
return
false
;
38
}
39
40
bool
UpdateKeyRepeat
(
const
unsigned
char
* keys,
bool
shift,
float
elapsed)
41
{
42
bool
handled =
false
;
43
for
(
auto
* instrument :
instruments
)
44
if
(instrument->UpdateKeyRepeat(keys, shift, elapsed)) handled =
true
;
45
return
handled;
46
}
47
48
void
FrameMove
(
float
fElapsed)
49
{
50
Rendering::ProfileCpuScope11
pageTiming(
"Page"
,
name
.c_str());
51
for
(UINT i = 0; i <
elements
.size(); i++)
52
elements
.at(i).Update();
53
for
(UINT i = 0; i <
instruments
.size(); i++)
54
{
55
Rendering::ProfileCpuScope11
instrumentTiming(
instruments
.at(i)->profileName.c_str());
56
instruments
.at(i)->FrameMove(fElapsed);
57
}
58
}
59
60
void
OnPageChanged
()
61
{
62
for
(UINT i = 0; i <
instruments
.size(); i++)
63
instruments
.at(i)->OnPageChanged();
64
}
65
};
Element.h
Instrument.h
Page
Definition
Page.h:7
Page::FrameMove
void FrameMove(float fElapsed)
Definition
Page.h:48
Page::name
std::string name
Definition
Page.h:9
Page::~Page
~Page()
Definition
Page.h:25
Page::Render
void Render()
Definition
Page.h:13
Page::HandleKeyPress
bool HandleKeyPress(short key, bool shift)
Definition
Page.h:30
Page::UpdateKeyRepeat
bool UpdateKeyRepeat(const unsigned char *keys, bool shift, float elapsed)
Definition
Page.h:40
Page::OnPageChanged
void OnPageChanged()
Definition
Page.h:60
Page::elements
std::vector< Element > elements
Definition
Page.h:11
Page::instruments
std::vector< Instrument * > instruments
Definition
Page.h:10
Rendering::ProfileCpuScope11
Definition
FrameProfiler11.h:697
Displays
Page.h
Generated on
for Rise by
1.18.0