Lugdunum  0.1.0
Surface.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 
6 
7 namespace lug {
8 namespace Graphics {
9 namespace Vulkan {
10 namespace API {
11 namespace Builder {
12 
13 class Instance;
14 
15 class Surface {
16 public:
17  Surface(const API::Instance& instance);
18 
19  Surface(const Surface&) = delete;
20  Surface(Surface&&) = delete;
21 
22  Surface& operator=(const Surface&) = delete;
23  Surface& operator=(Surface&&) = delete;
24 
25  ~Surface() = default;
26 
27  // Setters
28 #if defined(LUG_SYSTEM_WINDOWS) // Win32 surface
29  void setWindowInformations(HINSTANCE hinstance, HWND hwnd);
30 #elif defined(LUG_SYSTEM_LINUX) // Linux surface
31  void setWindowInformations(Display* dpy, ::Window window);
32 #elif defined(LUG_SYSTEM_ANDROID) // Android Surface
33  void setWindowInformations(ANativeWindow* window);
34 #endif
35 
36  // Build methods
37  bool build(API::Surface& instance, VkResult* returnResult = nullptr);
38  std::unique_ptr<API::Surface> build(VkResult* returnResult = nullptr);
39 
40 private:
42 
43 #if defined(LUG_SYSTEM_WINDOWS) // Win32 surface
44  HINSTANCE _hinstance;
45  HWND _hwnd;
46 #elif defined(LUG_SYSTEM_LINUX) // Linux surface
47  Display* _dpy;
48  ::Window _window;
49 #elif defined(LUG_SYSTEM_ANDROID) // Android Surface
50  ANativeWindow* _window;
51 #endif
52 };
53 
55 
56 } // Builder
57 } // API
58 } // Vulkan
59 } // Graphics
60 } // lug
Surface(const API::Instance &instance)
Definition: Surface.cpp:11
bool build(API::Surface &instance, VkResult *returnResult=nullptr)
Definition: Surface.cpp:13
Surface & operator=(const Surface &)=delete