BsGLRenderSystemFactory.h 763 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <string>
  3. #include "BsRenderSystemFactory.h"
  4. #include "BsRenderSystemManager.h"
  5. #include "BsGLRenderSystem.h"
  6. namespace BansheeEngine
  7. {
  8. const String SystemName = "BansheeGLRenderSystem";
  9. class GLRenderSystemFactory : public RenderSystemFactory
  10. {
  11. public:
  12. virtual void create();
  13. virtual const String& name() const { return SystemName; }
  14. private:
  15. class InitOnStart
  16. {
  17. public:
  18. InitOnStart()
  19. {
  20. static RenderSystemFactoryPtr newFactory;
  21. if(newFactory == nullptr)
  22. {
  23. newFactory = bs_shared_ptr<GLRenderSystemFactory>();
  24. RenderSystemManager::instance().registerRenderSystemFactory(newFactory);
  25. }
  26. }
  27. };
  28. static InitOnStart initOnStart; // Makes sure factory is registered on program start
  29. };
  30. }