From 129f2e421e16bd008cdca8713cc91f67d103d94e Mon Sep 17 00:00:00 2001 From: Mel Date: Fri, 7 Jul 2023 23:05:14 +0200 Subject: Fix minor quality issues --- src/GFX/Window.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/GFX/Window.cpp') diff --git a/src/GFX/Window.cpp b/src/GFX/Window.cpp index 0a1828c..ea1fde4 100644 --- a/src/GFX/Window.cpp +++ b/src/GFX/Window.cpp @@ -23,11 +23,11 @@ Window::~Window() { glfwDestroyWindow(m_window); } -bool Window::should_close() { +bool Window::should_close() const { return glfwWindowShouldClose(m_window); } -GLFWwindow* Window::get() { +GLFWwindow* Window::get() const { return m_window; } @@ -39,8 +39,12 @@ Vector<2> Window::mouse_delta() { return m_mouse.update(m_window); } -bool Window::key(int key, int type) { - return (glfwGetKey(m_window, key) == type); +bool Window::key(int key, int type) const { + return glfwGetKey(m_window, key) == type; +} + +bool Window::mouse(int key, int type) const { + return glfwGetMouseButton(m_window, key) == type; } void Window::start_frame() { @@ -49,7 +53,7 @@ void Window::start_frame() { } void Window::on_size_change(void (callback)(GLFWwindow*, int, int)) { - glfwSetFramebufferSizeCallback(m_window, static_cast(callback)); + glfwSetFramebufferSizeCallback(m_window, callback); } } \ No newline at end of file -- cgit 1.4.1