feat: handle resizing

This commit is contained in:
2020-05-31 15:15:03 +02:00
parent 0a034170d9
commit cfb54f0e00
4 changed files with 114 additions and 19 deletions

View File

@@ -14,13 +14,11 @@
const int MAX_FRAMES_IN_FLIGHT = 2;
const int WIDTH = 800;
const int HEIGHT = 600;
class HelloTriangleApplication {
public:
void run();
bool frameBufferResized = false;
private:
MyVkInstance *myVkInstance;
VkSwapchainKHR swapChain;
@@ -43,7 +41,6 @@ private:
int currentFrame = 0;
// Vulkan initialisation
void createSurface();
void createSwapChain();
void createImageViews();
void createRenderPass();
@@ -54,6 +51,9 @@ private:
void createSyncObjects();
void initVulkan();
void recreateSwapChain();
void cleanupSwapChain();
// main loop
void mainLoop();
void drawFrame();
@@ -64,6 +64,7 @@ private:
// utility functions
VkShaderModule createShaderModule(const std::vector<char> &code);
static void frameBufferResizeCallback(void *thisptr, int width, int height);
};