Changed key and mouse button callback signatures
This commit is contained in:
1 parent
b6a449d8e3
commit
056589a6f9
14 files changed
+37
-28
No files matched your search
@@ -3,6 +3,7 @@
|
||||
#include "Enums.h"
|
||||
#include "Graphics.h"
|
||||
#include "Resources.h"
|
||||
#include <vulkan/vulkan_core.h>
|
||||
#define GLFW_EXPOSE_NATIVE_WAYLAND
|
||||
#define GLFW_EXPOSE_NATIVE_X11
|
||||
#include <GLFW/glfw3.h>
|
||||
@@ -91,7 +92,7 @@ void glfwKeyCallback(GLFWwindow* handle, int key, int, int action, int modifier)
|
||||
return;
|
||||
}
|
||||
auto* window = static_cast<Seele::Vulkan::Window*>(glfwGetWindowUserPointer(handle));
|
||||
window->keyPress(static_cast<Seele::KeyCode>(key), static_cast<InputAction>(action), static_cast<KeyModifier>(modifier));
|
||||
window->keyPress(static_cast<Seele::KeyCode>(key), static_cast<InputAction>(action), modifier);
|
||||
}
|
||||
|
||||
void glfwMouseMoveCallback(GLFWwindow* handle, double xpos, double ypos) {
|
||||
@@ -101,7 +102,7 @@ void glfwMouseMoveCallback(GLFWwindow* handle, double xpos, double ypos) {
|
||||
|
||||
void glfwMouseButtonCallback(GLFWwindow* handle, int button, int action, int modifier) {
|
||||
auto* window = static_cast<Seele::Vulkan::Window*>(glfwGetWindowUserPointer(handle));
|
||||
window->mouseButton(static_cast<MouseButton>(button), static_cast<InputAction>(action), static_cast<KeyModifier>(modifier));
|
||||
window->mouseButton(static_cast<MouseButton>(button), static_cast<InputAction>(action), static_cast<KeyModifierFlags>(modifier));
|
||||
}
|
||||
|
||||
void glfwScrollCallback(GLFWwindow* handle, double xoffset, double yoffset) {
|
||||
@@ -250,11 +251,11 @@ bool Seele::Vulkan::Window::shouldClose() const {
|
||||
|
||||
Gfx::PTexture2D Seele::Vulkan::Window::getBackBuffer() const { return PTexture2D(swapChainTextures[currentImageIndex]); }
|
||||
|
||||
void Seele::Vulkan::Window::setKeyCallback(std::function<void(Seele::KeyCode, InputAction, KeyModifier)> callback) { keyCallback = callback; }
|
||||
void Seele::Vulkan::Window::setKeyCallback(std::function<void(Seele::KeyCode, InputAction, KeyModifierFlags)> callback) { keyCallback = callback; }
|
||||
|
||||
void Seele::Vulkan::Window::setMouseMoveCallback(std::function<void(double, double)> callback) { mouseMoveCallback = callback; }
|
||||
|
||||
void Seele::Vulkan::Window::setMouseButtonCallback(std::function<void(MouseButton, InputAction, KeyModifier)> callback) { mouseButtonCallback = callback; }
|
||||
void Seele::Vulkan::Window::setMouseButtonCallback(std::function<void(MouseButton, InputAction, KeyModifierFlags)> callback) { mouseButtonCallback = callback; }
|
||||
|
||||
void Seele::Vulkan::Window::setScrollCallback(std::function<void(double, double)> callback) { scrollCallback = callback; }
|
||||
|
||||
@@ -264,11 +265,11 @@ void Seele::Vulkan::Window::setCloseCallback(std::function<void()> callback) { c
|
||||
|
||||
void Seele::Vulkan::Window::setResizeCallback(std::function<void(uint32, uint32)> callback) { resizeCallback = callback; }
|
||||
|
||||
void Seele::Vulkan::Window::keyPress(Seele::KeyCode code, InputAction action, KeyModifier modifier) { keyCallback(code, action, modifier); }
|
||||
void Seele::Vulkan::Window::keyPress(Seele::KeyCode code, InputAction action, KeyModifierFlags modifier) { keyCallback(code, action, modifier); }
|
||||
|
||||
void Seele::Vulkan::Window::mouseMove(double x, double y) { mouseMoveCallback(x, y); }
|
||||
|
||||
void Seele::Vulkan::Window::mouseButton(MouseButton button, InputAction action, KeyModifier modifier) { mouseButtonCallback(button, action, modifier); }
|
||||
void Seele::Vulkan::Window::mouseButton(MouseButton button, InputAction action, KeyModifierFlags modifier) { mouseButtonCallback(button, action, modifier); }
|
||||
|
||||
void Seele::Vulkan::Window::scroll(double x, double y) { scrollCallback(x, y); }
|
||||
|
||||
|
||||
Reference in new issue
Block a user