2022-09-20 01:28:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "xe_render_system.hpp"
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace app {
|
|
|
|
|
|
|
|
struct UniformBuffer {
|
|
|
|
alignas(16) glm::mat4 projectionView{1.f};
|
|
|
|
alignas(4) glm::vec3 lightDirection = glm::normalize(glm::vec3{-1.f, 3.f, 1.f});
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PushConstant {
|
|
|
|
alignas(16) glm::mat4 modelMatrix{1.f};
|
|
|
|
alignas(16) glm::mat4 normalMatrix{1.f};
|
|
|
|
};
|
|
|
|
|
|
|
|
class SimpleRenderer {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2022-09-21 02:02:58 +00:00
|
|
|
SimpleRenderer(xe::XeEngine &xeEngine, xe::XeImage *xeImage);
|
2022-09-20 01:28:41 +00:00
|
|
|
|
|
|
|
~SimpleRenderer() {};
|
|
|
|
|
|
|
|
SimpleRenderer(const SimpleRenderer&) = delete;
|
|
|
|
SimpleRenderer operator=(const SimpleRenderer&) = delete;
|
|
|
|
|
2022-09-21 02:02:58 +00:00
|
|
|
void render(std::vector<xe::XeGameObject> &gameObjects, xe::XeCamera &xeCamera, xe::XeImage *xeImage);
|
2022-09-20 01:28:41 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
xe::XeRenderSystem xeRenderSystem;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|