summaryrefslogtreecommitdiffhomepage
path: root/main
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-12-05 08:17:00 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-12-05 08:17:00 +0100
commit2679d49a53a3f9825ce855f6ed25b3b045ec5aa1 (patch)
tree9767e933c25aa6a9a0b5b692890d655ea5029e24 /main
parent38b4c1864fddb4ed552f2f4217395bd02e21c5fe (diff)
editor, main: use less sdl includes
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