-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirst_app.hpp
More file actions
45 lines (37 loc) · 1012 Bytes
/
first_app.hpp
File metadata and controls
45 lines (37 loc) · 1012 Bytes
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
#pragma once
#include "lve_device.hpp"
#include "lve_model.hpp"
#include "lve_pipeline.hpp"
#include "lve_swap_chain.hpp"
#include "lve_window.hpp"
// std
#include <memory>
#include <vector>
namespace lve {
class FirstApp {
public:
static constexpr int WIDTH = 800;
static constexpr int HEIGHT = 600;
FirstApp();
~FirstApp();
FirstApp(const FirstApp&) = delete;
FirstApp& operator=(const FirstApp&) = delete;
void run();
private:
void loadModels();
void createPipelineLayout();
void createPipeline();
void createCommandBuffers();
void freeCommandBuffers();
void drawFrame();
void recreateSwapChain();
void recordCommandBuffer(int imageIndex);
LveWindow lveWindow{ WIDTH, HEIGHT, "Vulkan Tutorial" };
LveDevice lveDevice{ lveWindow };
std::unique_ptr<LveSwapChain> lveSwapChain;
std::unique_ptr<LvePipeline> lvePipeline;
VkPipelineLayout pipelineLayout;
std::vector<VkCommandBuffer> commandBuffers;
std::unique_ptr<LveModel> lveModel;
};
} // namespace lve