feat: refactor to separate files

This commit is contained in:
2020-05-30 13:25:45 +02:00
parent 5fd5ea8564
commit 4c044a68a5
6 changed files with 300 additions and 221 deletions

View File

@@ -5,6 +5,8 @@
#ifndef VULKANTEST_HELLOTRIANGLEAPPLICATION_H
#define VULKANTEST_HELLOTRIANGLEAPPLICATION_H
#include "MyVkInstance.h"
#include <vector>
#define GLFW_INCLUDE_VULKAN
@@ -20,14 +22,7 @@ public:
void run();
private:
GLFWwindow* window;
VkInstance instance;
VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
VkDevice device;
VkQueue graphicsQueue;
VkQueue presentQueue;
VkSurfaceKHR surface;
VkDebugUtilsMessengerEXT debugMessenger;
MyVkInstance *myVkInstance;
VkSwapchainKHR swapChain;
std::vector<VkImage> swapChainImages;
std::vector<VkImageView> swapChainImageViews;
@@ -47,13 +42,7 @@ private:
int currentFrame = 0;
// window creation
void initWindow();
// Vulkan initialisation
void createInstance();
void pickPhysicalDevice();
void createLogicalDevice();
void createSurface();
void createSwapChain();
void createImageViews();