Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
DefaultScene.cpp
Go to the documentation of this file.
1
2
4
6
11
13
16
17#include "Core/Headers/Kernel.h"
22
23
24namespace Divide
25{
26
27
28DefaultScene::DefaultScene(PlatformContext& context, Project& parent, const SceneEntry& entry)
29 : Scene(context, parent, entry)
30{
31 Scene::DEFAULT_SCENE_GUID = getGUID();
32}
33
34bool DefaultScene::load() {
35 const bool loadState = Scene::load();
36 state()->saveLoadDisabled(true);
37
38 addGuiTimer(TimerClass::APP_TIME,
39 Time::SecondsToMicroseconds( 0.25),
40 [this]( [[maybe_unused]] const U64 elapsedTimeUS )
41 {
42 _GUI->modifyText( "RenderBinCount",
43 Util::StringFormat( "Number of items in Render Bin: {}.", _context.kernel().renderPassManager()->getLastTotalBinSize( RenderStage::DISPLAY ) ),
44 false );
45 });
46
47 addGuiTimer( TimerClass::APP_TIME,
48 Time::SecondsToMicroseconds( 1.0 ),
49 [this]( const U64 elapsedTimeUS )
50 {
51 _GUI->modifyText( "timeDisplay",
52 Util::StringFormat( "Elapsed time: {:5.0f}", Time::MicrosecondsToSeconds(elapsedTimeUS)),
53 false);
54 });
55
56 return loadState;
57}
58
59void DefaultScene::postLoadMainThread()
60{
61 _GUI->addText( "timeDisplay",
62 pixelPosition( 60, 80 ),
63 Font::DIVIDE_DEFAULT,
64 UColour4( 64, 64, 355, 255 ),
65 "Elapsed time: 0.0f" );
66
67 _GUI->addText( "RenderBinCount",
68 pixelPosition( 60, 135 ),
69 Font::BATANG,
70 UColour4( 164, 32, 32, 255 ),
71 "Number of items in Render Bin: 0" );
72 Scene::postLoadMainThread();
73}
74
75}
constexpr Optick::Category::Type Scene
Definition: Profiler.h:66
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
RelativePosition2D pixelPosition(const I32 x, const I32 y)
Definition: Dimension.h:61
Project & parent
Definition: DefaultScene.h:41
vec4< U8 > UColour4
Definition: MathHelper.h:72
Project const SceneEntry & entry
Definition: DefaultScene.h:41