Cogs.Core
DimeLoaderExtension.cpp
1#include "ExtensionRegistry.h"
2#include "EntityDefinitions.h"
3
4#include "Resources/ModelManager.h"
5#include "Context.h"
6
7#include "DimeLoader.h"
8
9using namespace Cogs::Core;
10using namespace Cogs::Reflection;
11
12namespace Cogs
13{
14 namespace Core
15 {
17 {
18 DimeLoaderExtension() { ExtensionRegistry::add(this, COGS_CORE_VERSION_STRING); }
19
20 bool initialize(Context * context) override
21 {
22 context->modelManager->registerLoader(new DimeLoader());
23 return true;
24 }
25
26 const char * getExtensionKey() const override { return "Dime"; }
27 } dimeLoaderExtensionInstance;
28 }
29}
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
static void add(Extension *extension, StringView version)
Adds the given extension to the registry, ensuring the initialization methods are called at appropria...
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
Contains reflection support.
Definition: Component.h:11
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
bool initialize(Context *context) override
Initialize extension for the given context.
const char * getExtensionKey() const override
Get the extensions unique key, used to check for extension presence and retrieve extension specific d...
Defines an extension to Cogs.Core and provides methods to override in order to initialize extension c...