summaryrefslogtreecommitdiffhomepage
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/CMakeLists.txt9
-rw-r--r--main/events.cpp7
2 files changed, 15 insertions, 1 deletions
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index b40015e8..50e1bc91 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -10,6 +10,15 @@ target_link_libraries(${self} PUBLIC
fmt::fmt
)
+if(NOT SDL2_INCLUDE_DIRS)
+ if(NOT TARGET SDL2::SDL2)
+ find_package(SDL2 QUIET REQUIRED)
+ else()
+ get_target_property(SDL2_INCLUDE_DIRS SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES)
+ endif()
+endif()
+include_directories("${SDL2_INCLUDE_DIRS}")
+
if(FLOORMAT_PRECOMPILED-HEADERS)
target_precompile_headers(${self} PRIVATE precomp.hpp)
endif()
diff --git a/main/events.cpp b/main/events.cpp
index 11076b54..17db862f 100644
--- a/main/events.cpp
+++ b/main/events.cpp
@@ -3,7 +3,7 @@
#include "floormat/events.hpp"
#include <cstring>
#include <SDL_events.h>
-//#include <SDL_video.h>
+#include <SDL_keyboard.h>
namespace floormat {
@@ -104,4 +104,9 @@ void main_impl::anyEvent(SDL_Event& event)
return app.on_any_event(make_any_event(event));
}
+int floormat_main::get_mods() noexcept
+{
+ return (int)SDL_GetModState();
+}
+
} // namespace floormat