window resize handled, instance improved a bit
This commit is contained in:
parent
e114c36690
commit
2b33897b4a
16 changed files with 182 additions and 115 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "logicaldevice.h"
|
||||
|
||||
#include "swapchain.h"
|
||||
#include <iostream>
|
||||
|
||||
constexpr int MAX_FRAMES_IN_FLIGHT = 2;
|
||||
constexpr float queuePriority = 1.0f;
|
||||
|
@ -269,6 +270,10 @@ void Engine::LogicalDevice::drawFrame() {
|
|||
currentFrame = (currentFrame + 1) % MAX_FRAMES_IN_FLIGHT;
|
||||
}
|
||||
|
||||
void Engine::LogicalDevice::setResized() {
|
||||
framebufferResized = true;
|
||||
}
|
||||
|
||||
VkExtent2D Engine::LogicalDevice::chooseSwapExtent() const {
|
||||
return surface->chooseSwapExtent(phys->swapChainSupport.capabilities);
|
||||
}
|
||||
|
@ -564,5 +569,6 @@ void Engine::LogicalDevice::recordCommandBuffer(VkCommandBuffer commandBuffer, u
|
|||
void Engine::LogicalDevice::recreateSwapChain() {
|
||||
surface->waitForResize();
|
||||
waitIdle();
|
||||
phys->recreateSwapChainSupportDetails(surface);
|
||||
createSwapChain();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue