feat: handle resizing
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user