Cogs.Core
EchoSounderExtension.cpp
1#include "EchoSounderExtension.h"
2
3#include "Bridge/Bridge.h"
4
5#include "Context.h"
6#include "ViewContext.h"
7#include "Engine.h"
8#include "EntityDefinitions.h"
9#include "EntityStore.h"
10#include "ExtensionRegistry.h"
11#include "Components/DataRefComponent.h"
12#include "Components/DataSetComponent.h"
13#include "Components/WindowComponent.h"
14#include "Components/LocationComponent.h"
15#include "Components/PingOutlineComponent.h"
16#include "Components/BeamGroupComponent.h"
17#include "Components/PingIsoComponent.h"
18#include "Components/SwathBottomComponent.h"
19#include "Components/SwathIsoComponent.h"
20#include "Components/OctProviderComponent.h"
21#include "Components/UniformGridComponent.h"
22#include "Components/UniformGridIsoComponent.h"
23#include "Resources/ResourceStore.h"
24#include "Renderer/IRenderer.h"
25#include "Serialization/EntityReader.h"
26#include "Services/Variables.h"
27#include "Systems/DataSetSystem.h"
28#include "Systems/PingIsoSystem.h"
29#include "Systems/SwathBottomSystem.h"
30#include "Systems/SwathIsoSystem.h"
31#include "Systems/OctProviderSystem.h"
32#include "Systems/UniformGridSystem.h"
33
34#include "Rendering/ICapabilities.h"
35#include "Rendering/IGraphicsDevice.h"
36
37#include "Foundation/Logging/Logger.h"
38#include "Foundation/Platform/IO.h"
39
40#include <algorithm>
41
42#include <glm/glm.hpp>
43#include <glm/gtc/type_ptr.hpp>
44
45using namespace Cogs::Core;
46
47namespace{
48 Cogs::Logging::Log logger = Cogs::Logging::getLogger("EchoSounderExtension");
49};
50
51EchoSounder::DataSetComponent* getComponent(Context* context,
52 EntityId entityId)
53{
54 auto entity = context->store->getEntityPtr(entityId);
55
56 if (!entity) {
57 return nullptr;
58 }
59
61}
62
63EchoSounder::UniformGridComponent* getUniformGridComponent(Context* context,
64 EntityId entityId)
65{
66 auto entity = context->store->getEntityPtr(entityId);
67
68 if (!entity) {
69 return nullptr;
70 }
71
73}
74
75int echosounderSetConfig(void * ctx,
76 EntityId entityId,
77 uint32_t coordSys,
78 uint32_t capacity,
79 uint32_t beamCount,
80 uint32_t sampleCount,
81 float depthOffset,
82 float depthStep,
83 uint32_t useDecibel,
84 uint32_t tryPreserve,
85 const float* transducerAlpha,
86 const float* transducerOffset,
87 const float* directionX,
88 const float* directionY,
89 const float* beamWidthX,
90 const float* beamWidthY)
91{
92 auto context = reinterpret_cast<Context *>(ctx);
93 auto component = getComponent(context, entityId);
94 if (!component){
95 return -1;
96 }
97 if (1000 < component->messages.size()) {
98 // Make sure memory use doesn't run away if we get a unlikely large bubble.
99 return -1;
100 }
101 auto configMessage = new EchoSounder::ConfigMessage();
102 configMessage->config.coordSys = coordSys;
103 configMessage->config.capacity = capacity;
104 configMessage->config.beamCount = beamCount;
105 configMessage->config.sampleCount = sampleCount;
106 configMessage->config.depthOffset = depthOffset;
107 configMessage->config.depthStep = depthStep;
108 configMessage->config.useDecibel = (useDecibel != 0);
109 configMessage->config.tryPreserve = (tryPreserve != 0);
110 configMessage->config.transducerAlpha = glm::make_vec3(transducerAlpha);
111 configMessage->config.transducerOffset = glm::make_vec3(transducerOffset);
112
113 configMessage->config.directionX.resize(beamCount);
114 std::memcpy(configMessage->config.directionX.data(), directionX, sizeof(float)*beamCount);
115
116 configMessage->config.directionY.resize(beamCount);
117 std::memcpy(configMessage->config.directionY.data(), directionY, sizeof(float)*beamCount);
118
119 configMessage->config.beamWidthX.resize(beamCount);
120 std::memcpy(configMessage->config.beamWidthX.data(), beamWidthX, sizeof(float)*beamCount);
121
122 configMessage->config.beamWidthY.resize(beamCount);
123 std::memcpy(configMessage->config.beamWidthY.data(), beamWidthY, sizeof(float)*beamCount);
124
125 component->messages.push_back(configMessage);
126
127 return 0;
128}
129
130int echosounderClearPings(void * ctx, EntityId entityId)
131{
132 auto context = reinterpret_cast<Context *>(ctx);
133 auto component = getComponent(context, entityId);
134 if (!component) {
135 return -1;
136 }
137 if (1000 < component->messages.size()) {
138 // Make sure memory use doesn't run away if we get a unlikely large bubble.
139 return -1;
140 }
141
142 component->messages.push_back(new EchoSounder::ClearMessage());
143
144 return 0;
145}
146
147int echosounderAddPing(void * ctx,
148 EntityId entityId,
149 uint32_t beamCount,
150 uint32_t sampleCount,
151 int64_t timestamp,
152 const float* position,
153 const float* orientation,
154 const float* samples,
155 const float* bottomDepths,
156 const float* bottomReflectivities)
157{
158 auto context = reinterpret_cast<Context *>(ctx);
159 auto component = getComponent(context, entityId);
160 if (!component) {
161 return -1;
162 }
163 if (1000 < component->messages.size()) {
164 // Make sure memory use doesn't run away if we get a unlikely large bubble.
165 return -1;
166 }
167
168 auto pingMessage = new EchoSounder::PingMessage();
169 auto & p = pingMessage->ping;
170
171 p.beamCount = beamCount;
172 p.sampleCount = sampleCount;
173 p.timestamp = timestamp;
174 p.position = glm::make_vec3(position);
175 p.orientation = glm::make_quat(orientation);
176
177 p.storage.resize(p.storageSize(), false);
178 std::memcpy(p.values(), samples, p.valuesSize());
179 if (bottomDepths) {
180 std::memcpy(p.bottomDepths(), bottomDepths, p.bottomDepthsSize());
181 }
182 else {
183 std::memset(p.bottomDepths(), ~0u, p.bottomDepthsSize());
184 }
185
186 if (bottomReflectivities) {
187 std::memcpy(p.bottomReflectivities(), bottomReflectivities, p.bottomReflectivitiesSize());
188 }
189 else {
190 std::memset(p.bottomReflectivities(), ~0u, p.bottomReflectivitiesSize());
191 }
192
193 component->messages.push_back(pingMessage);
194
195 return 0;
196}
197
198int uniformGridAddConfig(void * ctx,
199 EntityId entityId,
200 uint32_t configId,
201 uint32_t coordSys,
202 uint32_t majorCount,
203 uint32_t minorCount,
204 uint32_t sampleCount,
205 float depthOffset,
206 float depthStep,
207 const float* transducerAlpha,
208 const float* transducerOffset,
209 const float* directionX,
210 const float* directionY,
211 const float* beamWidthX,
212 const float* beamWidthY)
213{
214 Context *context = reinterpret_cast<Context *>(ctx);
215 auto component = getUniformGridComponent(context, entityId);
216 auto system = ExtensionRegistry::getExtensionSystem<EchoSounder::UniformGridSystem>(context);
217 if(component && system){
219 config.configId = configId;
220 config.coordSys = coordSys;
221 config.majorCount = majorCount;
222 config.minorCount = minorCount;
223 config.sampleCount = sampleCount;
224 config.depthOffset = depthOffset;
225 config.depthStep = depthStep;
226 config.transducerAlpha = glm::make_vec3(transducerAlpha);
227 config.transducerOffset = glm::make_vec3(transducerOffset);
228
229 uint32_t beamCount = minorCount*majorCount;
230 config.directionX.resize(beamCount);
231 std::memcpy(config.directionX.data(), directionX, sizeof(float)*beamCount);
232 config.directionY.resize(beamCount);
233 std::memcpy(config.directionY.data(), directionY, sizeof(float)*beamCount);
234 config.beamWidthX.resize(beamCount);
235 std::memcpy(config.beamWidthX.data(), beamWidthX, sizeof(float)*beamCount);
236 config.beamWidthY.resize(beamCount);
237 std::memcpy(config.beamWidthY.data(), beamWidthY, sizeof(float)*beamCount);
238
239 system->config(component, config);
240 }
241 return 0;
242}
243
244int uniformGridClearPings(void * ctx, EntityId entityId)
245{
246 Context *context = reinterpret_cast<Context*>(ctx);
247 auto component = getUniformGridComponent(context, entityId);
248 auto system = ExtensionRegistry::getExtensionSystem<EchoSounder::UniformGridSystem>(context);
249 if(component && system) system->clear(component);
250 return 0;
251}
252
253int uniformGridAddPing(void * ctx,
254 EntityId entityId,
255 uint32_t configId,
256 uint32_t beamCount,
257 uint32_t sampleCount,
258 int64_t timestamp,
259 const float* position,
260 const float* orientation,
261 const float* samples,
262 const float* /*bottomDepths*/,
263 const float* /*bottomReflectivities*/)
264{
265 Context *context = reinterpret_cast<Context *>(ctx);
266 auto component = getUniformGridComponent(context, entityId);
267 auto system = ExtensionRegistry::getExtensionSystem<EchoSounder::UniformGridSystem>(context);
268 if(component && system){
270 p.configId = configId;
271 p.timestamp = timestamp;
272 p.position = glm::make_vec3(position);
273 p.orientation = glm::make_quat(orientation);
274 size_t size = sizeof(float)*beamCount*sampleCount;
275 p.storage.resize(size, false);
276 std::memcpy(p.storage.data(), samples, size);
277 system->addPing(context, component, p);
278 }
279 return 0;
280}
281
282namespace {
283 // Sanity checks to make sure that functions actually match typedefs.
284 Cogs::Core::EchoSounder::SetConfigPtr setConfigPtr = echosounderSetConfig;
285 Cogs::Core::EchoSounder::ClearPingsPtr clearPingsPtr = echosounderClearPings;
286 Cogs::Core::EchoSounder::AddPingPtr addPingPtr = echosounderAddPing;
287}
288
289namespace Cogs
290{
291 namespace Core
292 {
293 namespace EchoSounder
294 {
295
297 {
298 EchoSounderExtension() { ExtensionRegistry::add(this, COGS_CORE_VERSION_STRING); }
299
300 bool initializeStatic() override;
301 bool initialize(Context * context) override;
302 void cleanup(Context * context) override;
303
304 void * getSymbolPointer(const char* symbol) const override
305 {
306 if (strcmp("setConfig", symbol) == 0) {
307 return setConfigPtr;
308 }
309 else if (strcmp("clearPings", symbol) == 0) {
310 return clearPingsPtr;
311 }
312 else if (strcmp("addPing", symbol) == 0) {
313 return addPingPtr;
314 }
315 else if (strcmp("uniformGridAddConfig", symbol) == 0) {
316 return uniformGridAddConfig;
317 }
318 else if (strcmp("uniformGridClearPings", symbol) == 0) {
319 return uniformGridClearPings;
320 }
321 else if (strcmp("uniformGridAddPing", symbol) == 0) {
322 return uniformGridAddPing;
323 }
324 else {
325 return nullptr;
326 }
327 }
328
329 const char * getExtensionKey() const override { return "EchoSounder"; }
330 } multiBeamExtension;
331 }
332 }
333}
334
335static void EchoSounderResize(ViewContext* view, int x, int y)
336{
337 Context* context = view->getContext();
338
339 if(!context->variables->get("renderer.oit.EchoSounderOITResize", true)) return;
340 if(!context) return;
341 // Scale OIT upscale parameters
342 auto device = context->device;
343 if(!device) return;
344 auto capabilites = device->getCapabilities();
345 if(!capabilites) return;
346 auto vendor = capabilites-> getVendor();
347 size_t max_oit_memory = 256;
348 if(vendor == Cogs::Vendors::Intel){
349 size_t vRam = capabilites->getDeviceCapabilities().DedicatedVideoMemory;
350 size_t sRam = capabilites->getDeviceCapabilities().DedicatedSystemMemory;
351 size_t shRam = capabilites->getDeviceCapabilities().SharedSystemMemory;
352 max_oit_memory = std::max((size_t)1024*1024*1024, std::max(vRam, std::max(sRam, shRam)));
353 }
354 else{
355 max_oit_memory = std::max((size_t)1024*1024*1024, capabilites->getDeviceCapabilities().DedicatedVideoMemory);
356 }
357 double factor = 0.8;
358 size_t app_memory = 500*1024*1024;
359 size_t oit_memory = (size_t)ceil((max_oit_memory*factor-app_memory));
360
361 float upscaleWidth = 1.0f;
362 float upscaleHeight = 1.0f;
363 int temporalUpscaleWidth = context->variables->get("renderer.oit.TemporalUpscaleWidth", 1);
364 int temporalUpscaleHeight = context->variables->get("renderer.oit.TemporalUpscaleHeight", 1);
365 size_t nodeBufferFactor = context->variables->get("renderer.oit.bufferFactor", 1);
366
367 size_t maxWidth = context->variables->get("renderer.oit.MaxWidth", 1920);
368 size_t maxHeight = context->variables->get("renderer.oit.MaxHeight", 1200);
369
370 size_t total_size;
371 while(1){
372 size_t width = x;
373 size_t height = y;
374
375 size_t width_s = (size_t)ceil(width/(upscaleWidth*temporalUpscaleWidth));
376 size_t height_s = (size_t)ceil(height/(upscaleHeight*temporalUpscaleHeight));
377 if(width_s > maxWidth){
378 upscaleWidth *=2;
379 continue;
380 }
381 if(height_s > maxHeight){
382 upscaleHeight *=2;
383 continue;
384 }
385
386 size_t res = width_s * height_s;
387
388 size_t listBuffer = res * 4;
389 size_t nodeBuffer = res * nodeBufferFactor * 8;
390 size_t dataBuffer = res * nodeBufferFactor * 16;
391
392 size_t DepthSubRes = res*4;
393 size_t OITColorSubRes = res*4;
394 size_t OITDepth = (size_t)ceil(width/upscaleWidth)*(size_t)ceil(height/upscaleHeight)*4;
395 size_t ColorTemporalA = (size_t)ceil(width/upscaleWidth)*(size_t)ceil(height/upscaleHeight)*4;
396 size_t ColorTemporalB = (size_t)ceil(width/upscaleWidth)*(size_t)ceil(height/upscaleHeight)*4;
397
398 total_size = listBuffer+nodeBuffer+dataBuffer +
399 DepthSubRes+OITColorSubRes+OITDepth+ColorTemporalA+ColorTemporalB;
400 if(total_size < oit_memory) break;
401 if(upscaleWidth <= upscaleHeight) upscaleWidth*=2;
402 else upscaleHeight*=2;
403 }
404
405 LOG_INFO(logger, "Resize %d %d upscale (%.1f, %.1f) temporalUpscale (%d, %d) factor %zu",
406 x, y, upscaleWidth, upscaleHeight, temporalUpscaleWidth, temporalUpscaleHeight, nodeBufferFactor);
407
408 context->variables->set("renderer.oit.UpscaleWidth", upscaleWidth);
409 context->variables->set("renderer.oit.UpscaleHeight", upscaleHeight);
410 context->variables->set("renderer.oit.TemporalUpscaleWidth", temporalUpscaleWidth);
411 context->variables->set("renderer.oit.TemporalUpscaleHeight", temporalUpscaleHeight);
412}
413
415{
416 DataSetComponent::registerType();
417 DataRefComponent::registerType();
418 WindowComponent::registerType();
419 LocationComponent::registerType();
420 PingOutlineComponent::registerType();
421 BeamGroupComponent::registerType();
422 SwathBottomComponent::registerType();
423 SwathIsoComponent::registerType();
424 PingIsoComponent::registerType();
425 OctProviderComponent::registerType();
426 UniformGridComponent::registerType();
427 UniformGridIsoComponent::registerType();
428 return true;
429}
430
432{
433 // Maximum number of new chunks to process per iteration.
434 context->variables->set("echo.maxNewChunks", 8);
435
436 // Maximum number of new samples in-between slices, on average.
437 context->variables->set("echo.maxPathUpsample", 3);
438
439 // Maximum number of new samples in-between depth samples.
440 context->variables->set("echo.maxDepthUpsample", 2);
441
442 // Maximum number of new samples in-between beams, on average.
443 context->variables->set("echo.maxBeamUpsample", 5);
444
445 // If slices are closer together than this threshold, use this threshold instead as distance.
446 context->variables->set("echo.minSliceDistance", 0.01);
447
448 context->variables->set("echo.remap.printQueues", false);
449
450 // Max number of tiles updated per iteration.
451 context->variables->set("echo.remap.maxTileUpdates", 8);
452
453 // Max number of pings added per iteration.
454 context->variables->set("echo.remap.maxPingAdd", 4);
455
456 context->variables->set("echo.remap.dump", false);
457
458 context->resourceStore->addResourceArchive("Cogs.Core.Extensions.EchoSounder.zip");
459
460 context->resourceStore->addSearchPath("../Extensions/EchoSounder/Data/");
461 context->resourceStore->addSearchPath("../Extensions/EchoSounder/Data/Materials/");
462 context->resourceStore->addSearchPath("../Extensions/EchoSounder/Data/Shaders/");
463
464 const auto dependencyDir = IO::expandEnvironmentVariable("CoinDir");
465
466 context->resourceStore->addSearchPath(dependencyDir + "/");
467 context->resourceStore->addSearchPath(dependencyDir + "/Materials/");
468 context->resourceStore->addSearchPath(dependencyDir + "/shaders/");
469
470 loadPermutations(context, "Permutations/EchoBizarreLighting.permutations");
471
472 context->registerDynamicComponentType("EchoWindowComponent");
473 context->registerDynamicComponentType("EchoDataRefComponent");
474 context->registerDynamicComponentType("EchoLocationComponent");
475 context->registerDynamicComponentType("EchoPingOutlineComponent");
476 context->registerDynamicComponentType("EchoBeamGroupComponent");
477 context->registerDynamicComponentType("EchoUniformGridIsoComponent");
478
479 readEntityDefinition(R"(
480{ "name": "EchoDataSet",
481 "components" : [
482 "EchoDataSetComponent",
483 "TransformComponent",
484 "SceneComponent",
485 ]
486})"
487, context->store);
488
489 readEntityDefinition(R"(
490{ "name": "EchoUniformGrid",
491 "components" : [
492 "EchoUniformGridComponent",
493 "EchoUniformGridIsoComponent",
494 "TransformComponent",
495 "SceneComponent",
496 ],
497 "defaults": [
498 { "EchoUniformGridIsoComponent": { "material": "MultibeamIsoMaterial" }},
499 ],
500})"
501, context->store);
502
503 readEntityDefinition(R"(
504{ "name": "EchoUniformGridIsoVisualizer",
505 "components" : [
506 "TransformComponent",
507 "SceneComponent",
508 "MeshComponent",
509 "SubMeshRenderComponent",
510 ]
511})"
512, context->store);
513
514 readEntityDefinition(R"(
515{ "name": "EchoUniformGridPointVisualizer",
516 "components" : [
517 "TransformComponent",
518 "SceneComponent",
519 "MeshComponent",
520 "MeshRenderComponent",
521 ]
522})"
523, context->store);
524
525 readEntityDefinition(R"(
526{ "name": "EchoSwathBottom",
527 "components": [
528 "EchoDataRefComponent",
529 "EchoWindowComponent",
530 "EchoBeamGroupComponent",
531 "EchoSwathBottomComponent",
532 "TransformComponent",
533 "SceneComponent",
534 "MaterialComponent"
535 ],
536})"
537, context->store);
538
539 readEntityDefinition(R"(
540{ "name": "EchoSwathIso",
541 "components": [
542 "EchoDataRefComponent",
543 "EchoWindowComponent",
544 "EchoBeamGroupComponent",
545 "EchoSwathIsoComponent",
546 "TransformComponent",
547 "SceneComponent"
548 ],
549 "defaults": [
550 { "EchoSwathIsoComponent": { "material": "MultibeamIsoMaterial" }},
551 ],
552})"
553, context->store);
554
555 readEntityDefinition(R"(
556{ "name": "EchoPingIso",
557 "components": [
558 "EchoDataRefComponent",
559 "EchoLocationComponent",
560 "EchoBeamGroupComponent",
561 "EchoPingIsoComponent",
562 "TransformComponent",
563 "SceneComponent",
564 "MeshComponent",
565 "SubMeshRenderComponent"
566 ],
567 "defaults": [
568 { "EchoPingIsoComponent": { "material": "ParametricGridMaterial" }},
569 { "EchoLocationComponent": { "updateTransform": false }},
570 ],
571})"
572, context->store);
573
574 readEntityDefinition(R"(
575{ "name": "EchoChunkSurface",
576 "components": [
577 "TransformComponent",
578 "SceneComponent",
579 "MeshComponent",
580 "SubMeshRenderComponent"
581 ]
582})"
583, context->store);
584
585 readEntityDefinition(R"(
586{ "name": "EchoPingOutline",
587 "components": [
588 "EchoDataRefComponent",
589 "EchoLocationComponent",
590 "EchoBeamGroupComponent",
591 "EchoPingOutlineComponent",
592 "TransformComponent",
593 "SceneComponent",
594 "MeshComponent",
595 "MeshRenderComponent",
596 "MaterialComponent"
597 ],
598 "defaults": [
599 { "MaterialComponent": { "enableLighting": false }},
600 ],
601})"
602, context->store);
603
604 readEntityDefinition(R"(
605{ "name": "EchoConfigAnnotation",
606 "components": [
607 "TransformComponent",
608 "SceneComponent",
609 "AnnotationAxisComponent",
610 "TextComponent",
611 "SpriteRenderComponent",
612 ]
613})"
614, context->store);
615
616 readEntityDefinition(R"(
617{ "name": "EchoOctReference",
618 "components" : [
619 "EchoDataRefComponent",
620 "EchoBeamGroupComponent",
621 "SceneComponent"
622 ]
623})"
624, context->store);
625
626 readEntityDefinition(R"(
627{ "name": "EchoOctVolume",
628 "components" : [
629 "VolOctComponent",
630 "EchoOctProviderComponent",
631 "TransformComponent",
632 "SceneComponent"
633 ]
634})"
635, context->store);
636
637
638 auto dataSetSystem = ExtensionRegistry::registerExtensionSystem<DataSetSystem>(context, SystemPriority::PreDynamicComponents, 8);
639
640 ExtensionRegistry::registerExtensionSystem<UniformGridSystem>(context, SystemPriority::PreDynamicComponents, 8);
641
642 auto swathSeabedSystem = ExtensionRegistry::registerExtensionSystem<SwathBottomSystem>(context, SystemPriority::Geometry, 16);
643 swathSeabedSystem->setDataSystem(dataSetSystem);
644
645 auto swathIsoSystem = ExtensionRegistry::registerExtensionSystem<SwathIsoSystem>(context, SystemPriority::Geometry, 16);
646 swathIsoSystem->setDataSystem(dataSetSystem);
647
648 auto singlePingIsoSystem = ExtensionRegistry::registerExtensionSystem<PingIsoSystem>(context, SystemPriority::Geometry, 16);
649 singlePingIsoSystem->setDataSystem(dataSetSystem);
650
651 ExtensionRegistry::registerExtensionSystem<OctProviderSystem>(context, SystemPriority::PreGeometry, 4);
652
653 // Add EchoSounderResize
654 ViewContext* defaultView = context->getDefaultView();
655 glm::vec2 size = defaultView->getSize();
656
657 EchoSounderResize(defaultView, (int)size.x, (int)size.y);
658 defaultView->addResizeCallback(&EchoSounderResize);
659 return true;
660}
661
663{
664 if(context) {
665 ViewContext* defaultView = context->getDefaultView();
666
667 if (defaultView) {
668 defaultView->removeResizeCallback(&EchoSounderResize);
669 }
670 }
671}
T * getComponent() const
Get a pointer to the first component implementing the given type in the entity.
Definition: Entity.h:35
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
void registerDynamicComponentType(const StringView &typeName)
Register a dynamic component type with the given typeName.
Definition: Context.cpp:380
class EntityStore * store
Entity store.
Definition: Context.h:231
std::unique_ptr< class Variables > variables
Variables service instance.
Definition: Context.h:180
std::unique_ptr< class ResourceStore > resourceStore
ResourceStore service instance.
Definition: Context.h:210
ComponentModel::Entity * getEntityPtr(const EntityId entityId)
Get a raw pointer to the entity with the given id.
static void add(Extension *extension, StringView version)
Adds the given extension to the registry, ensuring the initialization methods are called at appropria...
Log implementation class.
Definition: LogManager.h:139
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
constexpr Log getLogger(const char(&name)[LEN]) noexcept
Definition: LogManager.h:180
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
void * getSymbolPointer(const char *symbol) const override
Get pointer to symbol defined by extension.
const char * getExtensionKey() const override
Get the extensions unique key, used to check for extension presence and retrieve extension specific d...
bool initializeStatic() override
Initialize extension statically.
bool initialize(Context *context) override
Initialize extension for the given context.
void cleanup(Context *context) override
Cleanup context bound extension content.
Defines an extension to Cogs.Core and provides methods to override in order to initialize extension c...
@ PreDynamicComponents
Run before the dynamic components.
Definition: Engine.h:46
@ Geometry
Run at the time geometry data is updated.
Definition: Engine.h:70
@ PreGeometry
Run before geometry updates are performed.
Definition: Engine.h:68