#pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include using std::unique_ptr, std::make_unique; using std::vector; class Instance; class Swapchain; class GraphicsPipeline; class Buffer; class CommandPool; class Image; class ComputePipeline; class Fence; class Semaphore; class Camera; class DescriptorPool; class Application { public: explicit Application(); void mainLoop(); ~Application(); protected: Swapchain* swapchain = nullptr; DescriptorPool* descriptorPool = nullptr; GraphicsPipeline* graphicsPipeline = nullptr; Buffer* uniformBuffer = nullptr; void updateUniformBuffer(); void recordGraphicsCommandBuffer(uint32_t imageIndex); Semaphore* imageAvailable = nullptr; Semaphore* renderFinished = nullptr; Semaphore* computeFinished = nullptr; Fence* renderInFlight = nullptr; Fence* computeInFlight = nullptr; void drawFrame(); virtual void recordDrawCommands() {}; virtual void recordComputeCommands(VkCommandBuffer cmdBuffer) {} void update(); void createSyncObjects(); Camera* camera = nullptr; };