minecraftvulkan/src/skinned_renderer.hpp

37 lines
740 B
C++
Raw Permalink Normal View History

2022-09-20 01:28:41 +00:00
#pragma once
#include "xe_render_system.hpp"
2022-09-20 01:28:41 +00:00
#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};
};
2022-10-03 10:50:49 +00:00
class SkinnedRenderer {
2022-09-20 01:28:41 +00:00
public:
2022-10-03 10:50:49 +00:00
SkinnedRenderer(std::vector<xe::Image*> &images);
2022-09-20 01:28:41 +00:00
2022-10-03 10:50:49 +00:00
~SkinnedRenderer() {};
2022-09-20 01:28:41 +00:00
2022-10-03 10:50:49 +00:00
SkinnedRenderer(const SkinnedRenderer&) = delete;
SkinnedRenderer operator=(const SkinnedRenderer&) = delete;
2022-09-20 01:28:41 +00:00
2022-09-26 22:03:07 +00:00
void render(std::vector<xe::GameObject> &gameObjects, xe::Camera &xeCamera);
2022-09-20 01:28:41 +00:00
private:
2022-09-25 01:16:13 +00:00
std::unique_ptr<xe::RenderSystem> xeRenderSystem;
2022-09-20 01:28:41 +00:00
};
}