Kale
Loading...
Searching...
No Matches
Core.hpp
Go to the documentation of this file.
1/*
2 Copyright 2022 Rishi Challa
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#pragma once
18
19#ifdef KALE_VULKAN
20
24
25#include <vulkan/vulkan.hpp>
26
27namespace Kale::Vulkan {
28
32 class Core {
33 private:
34 #ifdef KALE_DEBUG
35
39 static inline VkDebugUtilsMessengerEXT debugMessenger;
40
44 static void setupDebugMessageCallback();
45
49 static void destroyDebugMessageCallback();
50
51 #endif
52
56 static void createInstance();
57
61 static void createCommandPool();
62
67 static void chooseDevice(std::optional<uint32_t> gpuID);
68
69 protected:
70
75 static void setupCore(std::optional<uint32_t> gpuID = std::optional<uint32_t>());
76
80 static void cleanupCore();
81
82 friend class Kale::Application;
83
84 public:
85
89 static inline vk::UniqueInstance instance;
90
94 static inline vk::UniqueSurfaceKHR surface;
95
99 static inline Device device;
100
104 static inline SwapChain swapchain;
105
109 static inline vk::UniqueCommandPool commandPool;
110 };
111
112}
113
114#endif
static Device device
Definition Core.hpp:99
static vk::UniqueInstance instance
Definition Core.hpp:89
static vk::UniqueSurfaceKHR surface
Definition Core.hpp:94
static void chooseDevice(std::optional< uint32_t > gpuID)
static void cleanupCore()
Definition CoreSetup.cpp:68
static void createCommandPool()
static vk::UniqueCommandPool commandPool
Definition Core.hpp:109
static void setupCore(std::optional< uint32_t > gpuID=std::optional< uint32_t >())
Definition CoreSetup.cpp:37
static SwapChain swapchain
Definition Core.hpp:104
static void createInstance()
Definition CoreSetup.cpp:88