From 2679d49a53a3f9825ce855f6ed25b3b045ec5aa1 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 5 Dec 2022 08:17:00 +0100 Subject: editor, main: use less sdl includes --- main/CMakeLists.txt | 9 +++++++++ main/events.cpp | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'main') 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 #include -//#include +#include 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 -- cgit v1.2.3