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