You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.2 KiB
62 lines
1.2 KiB
#pragma once
|
|
|
|
#include <GLFW/glfw3.h>
|
|
|
|
#include <iostream>
|
|
#include <vector>
|
|
#include <cstring>
|
|
#include <optional>
|
|
#include <set>
|
|
#include <fstream>
|
|
#include <numeric>
|
|
#include <chrono>
|
|
#include <array>
|
|
#include <memory>
|
|
#include <vulkan/vulkan_core.h>
|
|
#include <map>
|
|
#include <glm/vec2.hpp>
|
|
|
|
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;
|
|
};
|
|
|