From bab0e7b65f790fca581ddf0167c1a636f682e0f3 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 20 Apr 2023 23:05:13 +0100 Subject: [PATCH] ifdef mouse wayland impl --- src/WallpaperEngine/Input/CMouseInput.cpp | 6 ++++-- src/WallpaperEngine/Input/CMouseInput.h | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/WallpaperEngine/Input/CMouseInput.cpp b/src/WallpaperEngine/Input/CMouseInput.cpp index 657efa1..4ac21a7 100644 --- a/src/WallpaperEngine/Input/CMouseInput.cpp +++ b/src/WallpaperEngine/Input/CMouseInput.cpp @@ -4,19 +4,21 @@ using namespace WallpaperEngine::Input; CMouseInput::CMouseInput (GLFWwindow* window) : position (), m_mousePosition (), m_window (window) {} - +#ifdef ENABLE_WAYLAND CMouseInput::CMouseInput(WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver* driver) { waylandDriver = driver; } +#endif void CMouseInput::update () { if (!m_window) { +#ifdef ENABLE_WAYLAND if (!waylandDriver || !waylandDriver->lastLSInFocus) return; this->position = waylandDriver->lastLSInFocus->mousePos; - +#endif return; } diff --git a/src/WallpaperEngine/Input/CMouseInput.h b/src/WallpaperEngine/Input/CMouseInput.h index 5b77d4b..3281116 100644 --- a/src/WallpaperEngine/Input/CMouseInput.h +++ b/src/WallpaperEngine/Input/CMouseInput.h @@ -1,6 +1,8 @@ #pragma once +#ifdef ENABLE_WAYLAND #include "../Render/Drivers/CWaylandOpenGLDriver.h" +#endif #include #include "GLFW/glfw3.h" @@ -15,9 +17,9 @@ namespace WallpaperEngine::Input { public: explicit CMouseInput(GLFWwindow* window); - +#ifdef ENABLE_WAYLAND explicit CMouseInput(WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver* driver); - +#endif /** * Takes current mouse position and updates it @@ -40,10 +42,12 @@ namespace WallpaperEngine::Input */ glm::dvec2 m_mousePosition; +#ifdef ENABLE_WAYLAND /** * Wayland: Driver */ WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver* waylandDriver = nullptr; +#endif }; }