MCPcopy Create free account
hub / github.com/KTStephano/StratusGFX / Initialize

Method Initialize

Examples/ExampleEnv03/Interrogation.cpp:47–85  ·  view source on GitHub ↗

Perform first-time initialization - true if success, false otherwise

Source from the content-addressed store, hash-verified

45
46 // Perform first-time initialization - true if success, false otherwise
47 virtual bool Initialize() override {
48 STRATUS_LOG << "Initializing " << GetAppName() << std::endl;
49
50 LightCreator::Initialize();
51
52 stratus::InputHandlerPtr controller(new CameraController());
53 INSTANCE(InputManager)->AddInputHandler(controller);
54
55 controller = stratus::InputHandlerPtr(new FrameRateController());
56 INSTANCE(InputManager)->AddInputHandler(controller);
57
58 //const glm::vec3 warmMorningColor = glm::vec3(254.0f / 255.0f, 232.0f / 255.0f, 176.0f / 255.0f);
59 //controller = stratus::InputHandlerPtr(new WorldLightController(warmMorningColor));
60 //INSTANCE(InputManager)->AddInputHandler(controller);
61
62 // Disable culling for this model since there are some weird parts that seem to be reversed
63 stratus::Async<stratus::Entity> e = stratus::ResourceManager::Instance()->LoadModel("../Resources/InterrogationRoom/scene.gltf", stratus::ColorSpace::SRGB, false, stratus::RenderFaceCulling::CULLING_NONE);
64 e.AddCallback([this](stratus::Async<stratus::Entity> e) {
65 if (e.Failed()) return;
66 interrogationRoom = e.GetPtr();
67 auto transform = stratus::GetComponent<stratus::LocalTransformComponent>(interrogationRoom);
68 //transform->SetLocalPosition(glm::vec3(0.0f));
69 transform->SetLocalScale(glm::vec3(15.0f));
70 INSTANCE(EntityManager)->AddEntity(interrogationRoom);
71 received.push_back(e.GetPtr());
72 });
73
74 requested.push_back(e);
75
76 auto settings = INSTANCE(RendererFrontend)->GetSettings();
77 settings.SetFogColor(glm::vec3(167.0f / 255.0f, 166.0f / 255.0f, 157.0f / 255.0f));
78 //settings.SetFogDensity(0.00125);
79 //settings.SetEmissionStrength(5.0f);
80 INSTANCE(RendererFrontend)->SetSettings(settings);
81
82 bool running = true;
83
84 return true;
85 }
86
87 // Run a single update for the application (no infinite loops)
88 // deltaSeconds = time since last frame

Callers

nothing calls this directly

Calls 10

AddInputHandlerMethod · 0.80
LoadModelMethod · 0.80
SetLocalScaleMethod · 0.80
AddEntityMethod · 0.80
GetSettingsMethod · 0.80
SetFogColorMethod · 0.80
SetSettingsMethod · 0.80
AddCallbackMethod · 0.45
FailedMethod · 0.45
GetPtrMethod · 0.45

Tested by

no test coverage detected