diff options
| author | vimene <vincent.menegaux@gmail.com> | 2025-12-24 01:38:45 +0100 |
|---|---|---|
| committer | vimene <vincent.menegaux@gmail.com> | 2025-12-24 01:38:45 +0100 |
| commit | 00370c21f107ff2a320fbdef170e24a8b5cda92a (patch) | |
| tree | 04ff3e32e88e0acdfe0783947a0f2510d0520a1f /src/vulkan_utils.hpp | |
| parent | 236b6a3160cd3d8c217a966aaa2795c779c13a91 (diff) | |
| download | engine-00370c21f107ff2a320fbdef170e24a8b5cda92a.tar.gz | |
added uniform buffers, small tweaks
- fixed aspect ratio being the inverse of what it's supposed to be
- use std::chrono::high_resolution_clock instead of system_clock
- convert ellapsed time to float representing seconds
- renamed engine::math::Matrix4::projection to perspective
- use [0,1] instead of [-1,1] for the range of z values, to be aligned
with vulkan
- added engine::math::Matrix4::{look_at,transpose}
Diffstat (limited to 'src/vulkan_utils.hpp')
| -rw-r--r-- | src/vulkan_utils.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vulkan_utils.hpp b/src/vulkan_utils.hpp index dd57afc..1efc73e 100644 --- a/src/vulkan_utils.hpp +++ b/src/vulkan_utils.hpp @@ -9,6 +9,7 @@ #include <GLFW/glfw3.h> #include "math/vector.hpp" +#include "math/mat4.hpp" #include "o3d/vertex.hpp" namespace engine::vk { @@ -59,6 +60,11 @@ struct Vertex { engine::math::Vector3 col; }; +// TODO: move to a better place. Also, see TODOs for struct Vertex +struct UniformBufferObject { + alignas(16) engine::math::Matrix4 model, view, proj; +}; + } #endif // VULKAN_UTILS_HPP |
