Ocular Engine
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
RenderableRegistrar.hpp
1
17
#pragma once
18
#ifndef __H__OCULAR_CORE_SCENE_RENDERABLE_REGISTRAR__H__
19
#define __H__OCULAR_CORE_SCENE_RENDERABLE_REGISTRAR__H__
20
21
#include "OcularEngine.hpp"
22
23
//------------------------------------------------------------------------------------------
24
29
namespace
Ocular
30
{
35
namespace
Core
36
{
40
template
<
class
T>
41
class
RenderableRegistrar
42
{
43
public
:
44
45
RenderableRegistrar
(std::string
const
& name)
46
{
47
if
(!OcularScene->getRenderableFactory().registerComponent<T>(name))
48
{
49
OcularLogger->error(
"Failed to register Renderable with name '"
, name,
"' as the name is already in use"
,
50
OCULAR_INTERNAL_LOG(
"RenderableRegistrar"
,
"RenderableRegistrar"
));
51
}
52
}
53
54
~
RenderableRegistrar
()
55
{
56
57
}
58
59
protected
:
60
61
private
:
62
};
63
}
67
}
72
#define OCULAR_REGISTER_RENDERABLE(x,y) Ocular::Core::RenderableRegistrar<x> OCULAR_INTERNAL_RenderableRegistrar(y);
73
74
//------------------------------------------------------------------------------------------
75
76
#endif
Ocular::Core::RenderableRegistrar
Definition:
RenderableRegistrar.hpp:41
Ocular
Note: Once this library is made dynamic, this will no longer be needed.
Definition:
Common.hpp:70
OcularCore
include
Scene
RenderableRegistrar.hpp
Generated on Tue Oct 18 2016 01:28:56 for Ocular Engine by
1.8.10