Finally handle swap chain recreation! resizing the window is possible now. Need to comment about what is happening in draw frames. Rewrote the main function to use a Singleton framework as well

This commit is contained in:
Lillian Salehi 2024-10-08 23:42:30 -05:00
parent db832a7dae
commit 5fca2134fe

View File

@ -12,6 +12,12 @@ namespace RenderPresent {
uint32_t currentFrame = 0;
void recreateSwapChain() {
int width = 0, height = 0;
glfwGetFramebufferSize(Global::window, &width, &height);
while (width == 0 || height == 0) {
glfwGetFramebufferSize(Global::window, &width, &height);
glfwWaitEvents();
}
vkDeviceWaitIdle(Global::device);
// Don't really wanna do this but I also don't want to create an extra class instance just to call the cleanup function.
for(auto framebuffer : pipeline.getSwapChainFramebuffers()) {