45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "cve_window.hpp"
|
|
#include "cve_pipeline.hpp"
|
|
#include "cve_device.hpp"
|
|
#include "cve_swap_chain.hpp"
|
|
#include "cve_model.hpp"
|
|
#include "cve_game_object.hpp"
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace cve {
|
|
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);
|
|
|
|
CveWindow cveWindow{WIDTH, HEIGHT, "Hello Vulkan!"};
|
|
CveDevice cveDevice{cveWindow};
|
|
std::unique_ptr<CveSwapChain> cveSwapChain;
|
|
std::unique_ptr<CvePipeline> cvePipeline;
|
|
VkPipelineLayout pipelineLayout;
|
|
std::vector<VkCommandBuffer> commandBuffers;
|
|
std::unique_ptr<CveModel> cveModel;
|
|
};
|
|
}
|