FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
C_logicalDevice.hpp
1/*
2 * Copyright 2024 Guillaume Guillet
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _FGE_VULKAN_C_LOGICALDEVICE_HPP_INCLUDED
18#define _FGE_VULKAN_C_LOGICALDEVICE_HPP_INCLUDED
19
20#include "FastEngine/fge_extern.hpp"
21#include "volk.h"
22
23namespace fge::vulkan
24{
25
26class PhysicalDevice;
27
36class FGE_API LogicalDevice
37{
38public:
40 LogicalDevice(LogicalDevice const& r) = delete;
41 LogicalDevice(LogicalDevice&& r) noexcept;
43
44 LogicalDevice& operator=(LogicalDevice const& r) = delete;
45 LogicalDevice& operator=(LogicalDevice&& r) noexcept = delete;
46
47 void create(PhysicalDevice& physicalDevice, VkSurfaceKHR surface);
48 void destroy();
49
50 [[nodiscard]] VkDevice getDevice() const;
51 [[nodiscard]] VkQueue getGraphicQueue() const;
52 [[nodiscard]] VkQueue getComputeQueue() const;
53 [[nodiscard]] VkQueue getTransferQueue() const;
54 [[nodiscard]] VkQueue getPresentQueue() const;
55 [[nodiscard]] VkPhysicalDeviceFeatures getEnabledFeatures() const;
56
57private:
58 VkDevice g_device;
59 VkQueue g_graphicQueue;
60 VkQueue g_computeQueue;
61 VkQueue g_transferQueue;
62 VkQueue g_presentQueue;
63 VkPhysicalDeviceFeatures g_enabledFeatures;
64};
65
66} // namespace fge::vulkan
67
68#endif //_FGE_VULKAN_C_LOGICALDEVICE_HPP_INCLUDED
Logical device abstraction.
Definition C_logicalDevice.hpp:37
Vulkan physical device abstraction.
Definition C_physicalDevice.hpp:34