feature/imgui-sdl
points-test
Last change
on this file since fe5c3ba was fe5c3ba, checked in by Dmitry Portnoy <dmp1488@…>, 5 years ago |
In vulkangame, change the pickPhysicalDevice() and isDeviceSuitable() functions to take the deviceExtensions list as a parameter
|
-
Property mode
set to
100644
|
File size:
1.5 KB
|
Line | |
---|
1 | #ifndef _VULKAN_GAME_H
|
---|
2 | #define _VULKAN_GAME_H
|
---|
3 |
|
---|
4 | #include "game-gui-sdl.hpp"
|
---|
5 |
|
---|
6 | #ifdef NDEBUG
|
---|
7 | const bool ENABLE_VALIDATION_LAYERS = false;
|
---|
8 | #else
|
---|
9 | const bool ENABLE_VALIDATION_LAYERS = true;
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | class VulkanGame {
|
---|
13 | public:
|
---|
14 | VulkanGame();
|
---|
15 | ~VulkanGame();
|
---|
16 |
|
---|
17 | void run(int width, int height, unsigned char guiFlags);
|
---|
18 |
|
---|
19 | private:
|
---|
20 | GameGui* gui;
|
---|
21 |
|
---|
22 | SDL_version sdlVersion;
|
---|
23 | SDL_Window* window;
|
---|
24 | SDL_Renderer* renderer;
|
---|
25 |
|
---|
26 | VkInstance instance;
|
---|
27 | VkDebugUtilsMessengerEXT debugMessenger;
|
---|
28 | VkSurfaceKHR surface; // TODO: Change the variable name to vulkanSurface
|
---|
29 | VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
|
---|
30 |
|
---|
31 | bool initWindow(int width, int height, unsigned char guiFlags);
|
---|
32 | void initVulkan();
|
---|
33 | void mainLoop();
|
---|
34 | void cleanup();
|
---|
35 |
|
---|
36 | void createVulkanInstance(const vector<const char*> &validationLayers);
|
---|
37 | void setupDebugMessenger();
|
---|
38 | void populateDebugMessengerCreateInfo(VkDebugUtilsMessengerCreateInfoEXT& createInfo);
|
---|
39 | void createVulkanSurface();
|
---|
40 | void pickPhysicalDevice(const vector<const char*>& deviceExtensions);
|
---|
41 | bool isDeviceSuitable(VkPhysicalDevice device, const vector<const char*>& deviceExtensions);
|
---|
42 |
|
---|
43 | static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(
|
---|
44 | VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
|
---|
45 | VkDebugUtilsMessageTypeFlagsEXT messageType,
|
---|
46 | const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
|
---|
47 | void* pUserData);
|
---|
48 | };
|
---|
49 |
|
---|
50 | #endif // _VULKAN_GAME_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.