Lugdunum  0.1.0
Instance.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 #include <vector>
6 
7 #include <lug/Core/Version.hpp>
9 
10 namespace lug {
11 namespace Graphics {
12 namespace Vulkan {
13 namespace API {
14 namespace Builder {
15 
16 class Instance {
17 public:
18  struct ApplicationInfo {
19  std::string appName;
21 
22  std::string engineName;
24 
26  };
27 
28 public:
29  Instance() = default;
30 
31  Instance(const Instance&) = delete;
32  Instance(Instance&&) = delete;
33 
34  Instance& operator=(const Instance&) = delete;
35  Instance& operator=(Instance&&) = delete;
36 
37  ~Instance() = default;
38 
39  // Setters
40  void setApplicationInfo(const std::string& name, const Core::Version& version = {0, 0, 0});
41  void setEngineInfo(const std::string& name, const Core::Version& version = {0, 0, 0});
42  void setRequiredVulkanVersion(const Core::Version& version = {0, 0, 0});
43 
44  void setLayers(const std::vector<const char*>& layers);
45  void setExtensions(const std::vector<const char*>& extensions);
46 
47  // Build methods
48  bool build(API::Instance& instance, VkResult* returnResult = nullptr);
49  std::unique_ptr<API::Instance> build(VkResult* returnResult = nullptr);
50 
51 private:
53 
54  std::vector<const char*> _layers;
55  std::vector<const char*> _extensions;
56 };
57 
59 
60 } // Builder
61 } // API
62 } // Vulkan
63 } // Graphics
64 } // lug
Stores the version of the Application.
Definition: Version.hpp:9
void setExtensions(const std::vector< const char *> &extensions)
Definition: Instance.inl:19
void setEngineInfo(const std::string &name, const Core::Version &version={0, 0, 0})
Definition: Instance.inl:6
void setRequiredVulkanVersion(const Core::Version &version={0, 0, 0})
Definition: Instance.inl:11
void setApplicationInfo(const std::string &name, const Core::Version &version={0, 0, 0})
Definition: Instance.inl:1
std::vector< const char * > _extensions
Definition: Instance.hpp:55
void setLayers(const std::vector< const char *> &layers)
Definition: Instance.inl:15
bool build(API::Instance &instance, VkResult *returnResult=nullptr)
Definition: Instance.cpp:9
Instance & operator=(const Instance &)=delete
std::vector< const char * > _layers
Definition: Instance.hpp:54