Compare commits

..

3 Commits

Author SHA1 Message Date
Ano-sys 49d32224af added alignas(16) for right 16 byte offsets 2025-04-04 18:04:38 +02:00
Ano-sys cf88fecf08 Altered glm::rotate parameters 2025-04-04 18:03:31 +02:00
Ano-sys 8e0234c1fb Printing programpath added 2025-04-04 18:02:53 +02:00
3 changed files with 10 additions and 5 deletions
+2 -1
View File
@@ -3,7 +3,8 @@
#include <iostream> #include <iostream>
#include "vulkan/vulkan_app.hpp" #include "vulkan/vulkan_app.hpp"
int main(){ int main(int argc, char **argv){
std::cout << "Program path: " << argv[0] << std::endl;
try{ try{
vapp::Vulkan app; vapp::Vulkan app;
app.run("Vulkan", 1200, 900); app.run("Vulkan", 1200, 900);
+4 -1
View File
@@ -967,9 +967,12 @@ namespace vapp{
auto currentTime = std::chrono::high_resolution_clock::now(); auto currentTime = std::chrono::high_resolution_clock::now();
float time = std::chrono::duration<float, std::chrono::seconds::period>(currentTime - startTime).count(); float time = std::chrono::duration<float, std::chrono::seconds::period>(currentTime - startTime).count();
// to not pass rotation over time instead by fps
// float time = (currentTime - startTime).count();
UniformBufferObject ubo{}; UniformBufferObject ubo{};
// INFO: Change here for other angles // INFO: Change here for other angles
ubo.model = glm::rotate(glm::mat4(1.0f), time * glm::radians(90.0f), glm::vec3(0.2f, 0.2f, 1.0f)); ubo.model = glm::rotate(glm::mat4(1.0f), time * glm::radians(60.0f), glm::vec3(0.2f, 0.2f, 0.8f));
ubo.view = glm::lookAt(glm::vec3(2.0f, 2.0f, 2.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 1.0f)); ubo.view = glm::lookAt(glm::vec3(2.0f, 2.0f, 2.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 1.0f));
ubo.proj = glm::perspective(glm::radians(45.0f), swapChainExtent.width / (float)swapChainExtent.height, 0.1f, 10.0f); ubo.proj = glm::perspective(glm::radians(45.0f), swapChainExtent.width / (float)swapChainExtent.height, 0.1f, 10.0f);
+4 -3
View File
@@ -9,6 +9,7 @@
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#define GLM_FORCE_RADIANS #define GLM_FORCE_RADIANS
#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/matrix_transform.hpp>
@@ -72,9 +73,9 @@ namespace vapp{
// END Remove // END Remove
struct UniformBufferObject{ struct UniformBufferObject{
glm::mat4 model; alignas(16) glm::mat4 model;
glm::mat4 view; alignas(16) glm::mat4 view;
glm::mat4 proj; alignas(16) glm::mat4 proj;
}; };
struct QueueFamilyIndices{ struct QueueFamilyIndices{