From 318263051a918ce69fb27de71cb1ac967b165c72 Mon Sep 17 00:00:00 2001 From: t Date: Tue, 8 Apr 2025 17:29:26 +0200 Subject: [PATCH] Resize true, cursor disabled --- vulkan/vulkan_app.cpp | 4 ++-- vulkan/vulkan_glfw_events.cpp | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/vulkan/vulkan_app.cpp b/vulkan/vulkan_app.cpp index af72e1c..dd6f295 100644 --- a/vulkan/vulkan_app.cpp +++ b/vulkan/vulkan_app.cpp @@ -1555,12 +1555,12 @@ namespace vapp{ void Vulkan::initWindow(const char *windowName){ glfwInit(); glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); // tell glfw to not use opengl - glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); // disable window resize + glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE); // disable window resize this->window = glfwCreateWindow(static_cast(_width), static_cast(_height), windowName, nullptr, nullptr); glfwSetWindowUserPointer(window, this); glfwSetFramebufferSizeCallback(window, framebufferResizeCallback); - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_CAPTURED); + glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); glfwSetCursorPosCallback(window, handleMouseInputCallback); } diff --git a/vulkan/vulkan_glfw_events.cpp b/vulkan/vulkan_glfw_events.cpp index b9bd9f5..95c92e9 100644 --- a/vulkan/vulkan_glfw_events.cpp +++ b/vulkan/vulkan_glfw_events.cpp @@ -96,25 +96,20 @@ namespace vapp{ xoffset *= sensitivity; yoffset *= sensitivity; - // Winkel aktualisieren yaw += xoffset; pitch += yoffset; - // Optional: pitch begrenzen if(pitch > 89.0f) pitch = 89.0f; if(pitch < -89.0f) pitch = -89.0f; - // Berechnung des neuen Richtungsvektors glm::vec3 direction; direction.x = cos(glm::radians(yaw)) * cos(glm::radians(pitch)); direction.y = sin(glm::radians(pitch)); direction.z = sin(glm::radians(yaw)) * cos(glm::radians(pitch)); direction = glm::normalize(direction); - // Der neue "Look-at"-Punkt ergibt sich aus der Kameraposition plus diesem Richtungsvektor cameraFront = cameraPos + direction; - } } \ No newline at end of file