wren
Vulkan-based game engine
Loading...
Searching...
No Matches
device.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <vulkan/vulkan.hpp>
4#include <vulkan/vulkan_handles.hpp>
6
7namespace wren::vulkan {
8
9class Device {
10 public:
11 static auto create(::vk::Instance const &instance,
12 ::vk::PhysicalDevice const &physical_device,
13 ::vk::SurfaceKHR const &surface)
15
16 [[nodiscard]] auto get() const -> ::vk::Device { return device_; }
17
18 [[nodiscard]] auto get_graphics_queue() const {
19 return graphics_queue_;
20 }
21
22 [[nodiscard]] auto get_present_queue() const {
23 return present_queue_;
24 }
25
26 [[nodiscard]] auto command_pool() const { return command_pool_; }
27
28 private:
29 auto create_device(::vk::Instance const &instance,
30 ::vk::PhysicalDevice const &physical_device,
31 ::vk::SurfaceKHR const &surface)
33
34 ::vk::CommandPool command_pool_;
35 ::vk::Device device_;
36 ::vk::Queue graphics_queue_;
37 ::vk::Queue present_queue_;
38};
39
40} // namespace wren::vulkan
Definition device.hpp:9
auto get_graphics_queue() const
Definition device.hpp:18
auto get() const -> ::vk::Device
Definition device.hpp:16
auto get_present_queue() const
Definition device.hpp:22
static auto create(::vk::Instance const &instance, ::vk::PhysicalDevice const &physical_device, ::vk::SurfaceKHR const &surface) -> expected< Device >
Definition device.cpp:15
auto command_pool() const
Definition device.hpp:26
Definition ui.hpp:5
Definition device.cpp:13
tl::expected< T, Err > expected
Definition errors.hpp:49