Lugdunum  0.1.0
Renderer.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdint>
4 #include <set>
5 #include <string>
6 
7 #include <lug/Core/Version.hpp>
12 
13 namespace lug {
14 namespace Graphics {
15 
16 class Graphics;
17 
19 public:
20  enum class Type : uint8_t {
21  Vulkan
22  };
23 
24  enum class DisplayMode : uint8_t {
25  Full,
26  Albedo,
27  Normal,
28  Metallic,
29  Roughness,
30  AmbientOcclusion,
31  AmbientOcclusionRoughnessMetallic,
32  Emissive
33  };
34 
35  struct InitInfo {
36  std::string shadersRoot;
38  DisplayMode displayMode{DisplayMode::Full};
39  };
40 
41 public:
42  Renderer(Graphics& graphics, Type type);
43 
44  Renderer(const Renderer&) = delete;
45  Renderer(Renderer&&) = delete;
46 
47  Renderer& operator=(const Renderer&) = delete;
48  Renderer& operator=(Renderer&&) = delete;
49 
50  virtual ~Renderer() = default;
51 
52  virtual bool beginInit(const std::string& appName, const Core::Version& appVersion, const InitInfo& initInfo) = 0;
53  virtual bool finishInit() = 0;
54 
55  virtual bool beginFrame(const lug::System::Time& elapsedTime) = 0;
56  virtual bool endFrame() = 0;
57 
58  virtual Render::Window* createWindow(Render::Window::InitInfo& initInfo) = 0;
59  virtual Render::Window* getWindow() = 0;
60 
61  const InitInfo& getInfo() const;
62  Type getType() const;
63 
64  const DisplayMode& getDisplayMode() const;
65  void setDisplayMode(DisplayMode displayMode);
66 
67  ResourceManager* getResourceManager() const;
68 
69 protected:
74  std::unique_ptr<ResourceManager> _resourceManager{nullptr};
75 };
76 
78 
79 } // Graphics
80 } // lug
Stores the version of the Application.
Definition: Version.hpp:9
#define LUG_GRAPHICS_API
Definition: Export.hpp:11
DisplayMode _displayMode
Definition: Renderer.hpp:72
Render::Technique::Type renderTechnique
Definition: Renderer.hpp:37
Class for resource manager. The ResourceManager allows the user to load resources and store them...
Class for graphics.
Definition: Graphics.hpp:25