Lugdunum
0.1.0
src
lug
Graphics
Vulkan
API
Surface.cpp
Go to the documentation of this file.
1
#include <
lug/Graphics/Vulkan/API/Surface.hpp
>
2
3
#include <
lug/Graphics/Vulkan/API/Instance.hpp
>
4
5
namespace
lug
{
6
namespace
Graphics {
7
namespace
Vulkan
{
8
namespace
API {
9
10
Surface::Surface
(VkSurfaceKHR surface,
const
Instance
* instance) : _surface(surface), _instance(instance) {}
11
12
Surface::Surface
(
Surface
&& surface) {
13
_surface
= surface._surface;
14
_instance
= surface.
_instance
;
15
surface._surface = VK_NULL_HANDLE;
16
surface._instance =
nullptr
;
17
}
18
19
Surface
&
Surface::operator=
(
Surface
&& surface) {
20
destroy
();
21
22
_surface
= surface._surface;
23
_instance
= surface.
_instance
;
24
surface._surface = VK_NULL_HANDLE;
25
surface._instance =
nullptr
;
26
27
return
*
this
;
28
}
29
30
Surface::~Surface
() {
31
destroy
();
32
}
33
34
void
Surface::destroy
() {
35
if
(
_surface
!= VK_NULL_HANDLE) {
36
vkDestroySurfaceKHR(static_cast<VkInstance>(*
_instance
),
_surface
,
nullptr
);
37
_surface
= VK_NULL_HANDLE;
38
}
39
}
40
41
}
// API
42
}
// Vulkan
43
}
// Graphics
44
}
// lug
lug::Graphics::Vulkan::API::Instance
Definition:
Instance.hpp:15
lug::Graphics::Vulkan::API::Surface
Definition:
Surface.hpp:17
Vulkan
Definition:
Vulkan.hpp:155
lug::Graphics::Vulkan::API::Instance::_instance
VkInstance _instance
Definition:
Instance.hpp:42
lug::Graphics::Vulkan::API::Surface::destroy
void destroy()
Definition:
Surface.cpp:34
lug::Graphics::Vulkan::API::Surface::_instance
const Instance * _instance
Definition:
Surface.hpp:42
lug::Graphics::Vulkan::API::Surface::_surface
VkSurfaceKHR _surface
Definition:
Surface.hpp:41
lug::Graphics::Vulkan::API::Surface::operator=
Surface & operator=(const Surface &)=delete
lug
Definition:
Application.hpp:11
Surface.hpp
Instance.hpp
lug::Graphics::Vulkan::API::Surface::~Surface
~Surface()
Definition:
Surface.cpp:30
lug::Graphics::Vulkan::API::Surface::Surface
Surface()=default
Generated by
1.8.13