Lugdunum  0.1.0
Graphics.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #define NOMINMAX
4 #include <algorithm>
5 #include <memory>
6 #include <set>
7 
8 #include <lug/Core/Version.hpp>
10 #include <lug/Graphics/Module.hpp>
14 
15 namespace lug {
16 namespace Graphics {
17 
26 public:
30  struct InitInfo {
33  std::set<Module::Type> mandatoryModules;
34  std::set<Module::Type> optionalModules;
35  };
36 
37 public:
44  Graphics(const std::string& appName, const Core::Version& appVersion);
45 
46  Graphics(const Graphics&) = delete;
47  Graphics(Graphics&&) = delete;
48 
49  Graphics& operator=(const Graphics&) = delete;
50  Graphics& operator=(Graphics&&) = delete;
51 
52  ~Graphics() = default;
53 
61  bool init(const InitInfo& initInfo);
62 
71  bool beginInit(const InitInfo& initInfo);
72 
79  bool finishInit();
80 
88  bool isModuleLoaded(Module::Type type) const;
89 
90  const std::set<Module::Type>& getLoadedMandatoryModules() const;
91  const std::set<Module::Type>& getLoadedOptionalModules() const;
92 
93  void unsupportedModule(Module::Type type);
94 
100  Renderer* getRenderer() const;
101 
102 private:
103  std::string _appName;
105 
107 
108  std::set<Module::Type> _loadedMandatoryModules{};
109  std::set<Module::Type> _loadedOptionalModules{};
110 
111  std::unique_ptr<Renderer> _renderer{nullptr};
112 };
113 
114 #include <lug/Graphics/Graphics.inl>
115 
116 } // Graphics
117 } // lug
Stores the version of the Application.
Definition: Version.hpp:9
#define LUG_GRAPHICS_API
Definition: Export.hpp:11
std::set< Module::Type > mandatoryModules
Definition: Graphics.hpp:33
Utility structure used to initialize the Graphics component.
Definition: Graphics.hpp:30
Core::Version _appVersion
Definition: Graphics.hpp:104
Renderer::InitInfo rendererInitInfo
Definition: Graphics.hpp:32
std::set< Module::Type > optionalModules
Definition: Graphics.hpp:34
Class for graphics.
Definition: Graphics.hpp:25