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(const ::vk::Instance &instance,
12 const ::vk::PhysicalDevice &physical_device,
13 const ::vk::SurfaceKHR &surface) -> expected<Device>;
14
15 [[nodiscard]] auto get() const -> ::vk::Device { return device_; }
16
17 [[nodiscard]] auto get_graphics_queue() const { return graphics_queue_; }
18
19 [[nodiscard]] auto get_present_queue() const { return present_queue_; }
20
21 [[nodiscard]] auto command_pool() const { return command_pool_; }
22
23 private:
24 auto create_device(const ::vk::Instance &instance,
25 const ::vk::PhysicalDevice &physical_device,
26 const ::vk::SurfaceKHR &surface) -> expected<void>;
27
28 ::vk::CommandPool command_pool_;
29 ::vk::Device device_;
30 ::vk::Queue graphics_queue_;
31 ::vk::Queue present_queue_;
32};
33
34} // namespace wren::vulkan
Definition device.hpp:9
auto get_graphics_queue() const
Definition device.hpp:17
auto get() const -> ::vk::Device
Definition device.hpp:15
auto create_device(const ::vk::Instance &instance, const ::vk::PhysicalDevice &physical_device, const ::vk::SurfaceKHR &surface) -> expected< void >
Definition device.cpp:25
::vk::Queue present_queue_
Definition device.hpp:31
auto get_present_queue() const
Definition device.hpp:19
::vk::Device device_
Definition device.hpp:29
::vk::Queue graphics_queue_
Definition device.hpp:30
auto command_pool() const
Definition device.hpp:21
static auto create(const ::vk::Instance &instance, const ::vk::PhysicalDevice &physical_device, const ::vk::SurfaceKHR &surface) -> expected< Device >
Definition device.cpp:14
::vk::CommandPool command_pool_
Definition device.hpp:28
Definition ui.hpp:5
Definition device.cpp:12
std::expected< T, Err > expected
Definition result.hpp:49