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.

63 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>
4 months ago
#include <map>
#include <glm/vec2.hpp>
4 months ago
using std::unique_ptr, std::make_unique;
using std::vector;
class Instance;
class Swapchain;
class GraphicsPipeline;
class Buffer;
class CommandPool;
4 months ago
class Image;
4 months ago
class ComputePipeline;
4 months ago
class Fence;
class Semaphore;
4 months ago
class Camera;
class DescriptorPool;
class Application {
public:
explicit Application();
void mainLoop();
~Application();
4 months ago
protected:
Swapchain* swapchain = nullptr;
DescriptorPool* descriptorPool = nullptr;
GraphicsPipeline* graphicsPipeline = nullptr;
Buffer* uniformBuffer = nullptr;
void updateUniformBuffer();
4 months ago
void recordGraphicsCommandBuffer(uint32_t imageIndex);
4 months ago
Semaphore* imageAvailable = nullptr;
Semaphore* renderFinished = nullptr;
Semaphore* computeFinished = nullptr;
Fence* renderInFlight = nullptr;
Fence* computeInFlight = nullptr;
void drawFrame();
4 months ago
virtual void recordDrawCommands() {};
4 months ago
virtual void recordComputeCommands(VkCommandBuffer cmdBuffer) {}
4 months ago
void update();
void createSyncObjects();
4 months ago
Camera* camera = nullptr;
};