Ocular Engine
RendererRegistrar.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_CORE_RENDERER_REGISTRAR__H__
19 #define __H__OCULAR_CORE_RENDERER_REGISTRAR__H__
20 
21 #include "OcularEngine.hpp"
22 
23 //------------------------------------------------------------------------------------------
24 
29 namespace Ocular
30 {
35  namespace Core
36  {
37  template<class T>
39  {
40  public:
41 
42  RendererRegistrar(std::string const& name)
43  {
44  if(!OcularScene->getRendererFactory().registerComponent<T>(name))
45  {
46  OcularLogger->error("Failed to register Renderer with name '", name, "' as the name is already in use", OCULAR_INTERNAL_LOG("RendererRegistrar", "RendererRegistrar"));
47  }
48  }
49 
51  {
52 
53  }
54 
55  protected:
56 
57  private:
58  };
59  }
63 }
68 #define OCULAR_REGISTER_RENDERER(x,y) Ocular::Core::RendererRegistrar<x> OCULAR_INTERNAL_RendererRegistrar(y);
69 
70 //------------------------------------------------------------------------------------------
71 
72 #endif
Definition: RendererRegistrar.hpp:38
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70