2024-02-21 13:28:50 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "hk_device.hpp"
|
2024-04-03 21:28:08 +08:00
|
|
|
#include "hk_game_object.hpp"
|
2024-02-21 13:28:50 +08:00
|
|
|
#include "hk_pipeline.hpp"
|
|
|
|
#include "hk_window.hpp"
|
2024-04-03 21:28:08 +08:00
|
|
|
#include "hk_renderer.hpp"
|
2024-02-21 13:28:50 +08:00
|
|
|
|
|
|
|
// std
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace hk
|
|
|
|
{
|
|
|
|
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:
|
2024-04-03 21:28:08 +08:00
|
|
|
void loadGameObjects();
|
2024-02-21 13:28:50 +08:00
|
|
|
void createPipelineLayout();
|
|
|
|
void createPipeline();
|
2024-04-03 21:28:08 +08:00
|
|
|
void renderGameObjects(VkCommandBuffer commandBuffer);
|
|
|
|
|
|
|
|
Window m_window{WIDTH, HEIGHT, "Hello Vulkan!"};
|
|
|
|
Device m_device{m_window};
|
|
|
|
Renderer m_renderer{m_window, m_device};
|
|
|
|
std::unique_ptr<Pipeline> m_pipeline;
|
|
|
|
VkPipelineLayout m_pipelineLayout;
|
|
|
|
std::vector<GameObject> m_gameObjects;
|
2024-02-21 13:28:50 +08:00
|
|
|
};
|
|
|
|
}
|