|
|
@ -1,4 +1,10 @@ |
|
|
|
#include "application.hpp" |
|
|
|
#include "application.hpp" |
|
|
|
|
|
|
|
#include "vertex.hpp" |
|
|
|
|
|
|
|
#include "swapchain.hpp" |
|
|
|
|
|
|
|
#include "pipeline.hpp" |
|
|
|
|
|
|
|
#include "instance.hpp" |
|
|
|
|
|
|
|
#include "buffer.hpp" |
|
|
|
|
|
|
|
#include "command_pool.hpp" |
|
|
|
|
|
|
|
|
|
|
|
Application::Application() { |
|
|
|
Application::Application() { |
|
|
|
instance = new Instance; |
|
|
|
instance = new Instance; |
|
|
@ -89,19 +95,6 @@ void Application::createSyncObjects() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Application::~Application() { |
|
|
|
|
|
|
|
delete swapchain; |
|
|
|
|
|
|
|
for (size_t i = 0; i < MAX_FRAMES_IN_FLIGHT; i++){ |
|
|
|
|
|
|
|
vkDestroySemaphore(instance->device, imageAvailableSemaphores[i], nullptr); |
|
|
|
|
|
|
|
vkDestroySemaphore(instance->device, renderFinishedSemaphores[i], nullptr); |
|
|
|
|
|
|
|
vkDestroyFence(instance->device, inFlightFences[i], nullptr); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
delete commandPool; |
|
|
|
|
|
|
|
delete buffer; |
|
|
|
|
|
|
|
delete pipeline; |
|
|
|
|
|
|
|
delete instance; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Application::recordCommandBuffer(VkCommandBuffer commandBuffer, uint32_t imageIndex) { |
|
|
|
void Application::recordCommandBuffer(VkCommandBuffer commandBuffer, uint32_t imageIndex) { |
|
|
|
VkCommandBufferBeginInfo beginInfo {}; |
|
|
|
VkCommandBufferBeginInfo beginInfo {}; |
|
|
|
beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; |
|
|
|
beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; |
|
|
@ -146,6 +139,19 @@ void Application::recordCommandBuffer(VkCommandBuffer commandBuffer, uint32_t im |
|
|
|
vkEndCommandBuffer(commandBuffer); |
|
|
|
vkEndCommandBuffer(commandBuffer); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Application::~Application() { |
|
|
|
|
|
|
|
delete swapchain; |
|
|
|
|
|
|
|
for (size_t i = 0; i < MAX_FRAMES_IN_FLIGHT; i++){ |
|
|
|
|
|
|
|
vkDestroySemaphore(instance->device, imageAvailableSemaphores[i], nullptr); |
|
|
|
|
|
|
|
vkDestroySemaphore(instance->device, renderFinishedSemaphores[i], nullptr); |
|
|
|
|
|
|
|
vkDestroyFence(instance->device, inFlightFences[i], nullptr); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
delete commandPool; |
|
|
|
|
|
|
|
delete buffer; |
|
|
|
|
|
|
|
delete pipeline; |
|
|
|
|
|
|
|
delete instance; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|