(NDK) Added explicit initialisation
Components and systems just can't be initialized at startup, so we need some kind of explicit initialisation. I followed the same layout as the others modules by adding a core class (Ndk::Sdk) which will initialize components and systems, and Nazara's modules. This is starting to get serious, I like it. Former-commit-id: 263500e8d16db70ef7f92047b8a7e3235c08bcd0
This commit is contained in:
@@ -30,4 +30,18 @@ namespace Ndk
|
||||
{
|
||||
return SystemType::systemIndex;
|
||||
}
|
||||
|
||||
template<typename ComponentType, unsigned int N>
|
||||
ComponentIndex InitializeComponent(const char (&name)[N])
|
||||
{
|
||||
ComponentType::componentIndex = ComponentType::RegisterComponent(name);
|
||||
return ComponentType::componentIndex;
|
||||
}
|
||||
|
||||
template<typename SystemType>
|
||||
SystemIndex InitializeSystem()
|
||||
{
|
||||
SystemType::systemIndex = SystemType::RegisterSystem();
|
||||
return SystemType::systemIndex;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user