-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVulkanRenderer.hpp
65 lines (51 loc) · 1.5 KB
/
VulkanRenderer.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
#include "RendererCommon.h"
#include "ValidationLayers.hpp"
#include "SwapchainManager.hpp"
#include "DeviceManager.hpp"
#include "Framebuffer.hpp"
#include "GraphicsPipeline.hpp"
#include "CommandBuffer.hpp"
#include "SyncObjects.hpp"
#include "VertexBuffer.hpp"
#include "IndexBuffer.hpp"
#include "UniformBuffer.hpp"
#include "Model.hpp"
#include "Camera.hpp"
class VulkanRenderer {
public:
VulkanRenderer() = default;
~VulkanRenderer();
VulkanRenderer(GLFWwindow* window, int& windowWidth, int& windowHeight,
const Camera& camera);
void drawFrame();
void wait();
void recieveModel(const Model& model);
void deleteModel(Model& model);
void deleteAllModels();
bool framebufferResized;
DeviceManager& getDeviceManager();
CommandBuffer& getCommandBuffer();
VkInstance& getInstance();
UniformBuffer& getUniformBuffer();
SwapchainManager& getSwapchainManager();
std::vector<Model> models;
private:
void createInstance();
void createSurface(GLFWwindow* window);
void recreateSwapchain();
GLFWwindow* window;
int& windowWidth;
int& windowHeight;
VkInstance instance;
VkSurfaceKHR surface;
std::unique_ptr<ValidationLayers> validationLayers;
std::unique_ptr<DeviceManager> deviceManager;
std::unique_ptr<SwapchainManager> swapchainManager;
std::unique_ptr<UniformBuffer> uniformBuffer;
std::unique_ptr<GraphicsPipeline> graphicsPipeline;
std::unique_ptr<CommandBuffer> commandbuffer;
std::unique_ptr<SyncObjects> syncObjects;
uint32_t currentFrame;
const int MAX_FRAMES_IN_FLIGHT;
};