Ocular Engine
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>
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 
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
Definition: RenderableRegistrar.hpp:41
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70