-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeneric_app.hpp
48 lines (39 loc) · 1.26 KB
/
generic_app.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
#pragma once
#include "spock_window.hpp"
#include "spock_pipeline.hpp"
#include "spock_device.hpp"
#include "spock_swapchain.hpp"
#include <vulkan/vulkan_core.h>
// std
#include <memory>
#include <vector>
namespace spock {
class GenericApp {
public:
static constexpr int WIDTH = 800;
static constexpr int HEIGHT = 600;
GenericApp();
~GenericApp();
// Enforce RAII
GenericApp(const GenericApp &) = delete;
GenericApp &operator=(const GenericApp &) = delete;
void run();
private:
void createPipelineLayout();
void createPipeline();
void createCommandBuffers();
void drawFrame();
SpockWindow spockWindow { WIDTH, HEIGHT, "Spock"};
SpockDevice spockDevice { spockWindow };
SpockSwapchain spockSwapchain { spockDevice, spockWindow.getExtent() };
// SpockPipeline spockPipeline {
// spockDevice,
// "shaders/simple_shader.vert.spv",
// "shaders/simple_shader.frag.spv",
// SpockPipeline::defaultPipelineConfigInfo(WIDTH, HEIGHT)
// };
std::unique_ptr<SpockPipeline> spockPipeline;
VkPipelineLayout pipelineLayout;
std::vector<VkCommandBuffer> commandBuffers;
};
}