diff --git a/demo/demo/main.cpp b/demo/demo/main.cpp index 95165bfce7ef422d26369bbe90037e21ab0deef3..2e689213c71af832635a0c0893211a6c3d80e5b7 100644 --- a/demo/demo/main.cpp +++ b/demo/demo/main.cpp @@ -31,7 +31,7 @@ #include "fggl/gfx/ogl/compat.hpp" #include "fggl/data/storage.hpp" -#include "fggl/util/service.h" +#include "fggl/util/service.hpp" #include "fggl/ecs3/types.hpp" #include "fggl/phys/bullet/bullet.hpp" diff --git a/demo/demo/rollball.cpp b/demo/demo/rollball.cpp index 4bef822b19670c8e8e673cb92d1dcb33ed75cc05..d22a7ba67a80ca18f0e5578eb4fbf82851aaea5f 100644 --- a/demo/demo/rollball.cpp +++ b/demo/demo/rollball.cpp @@ -22,8 +22,8 @@ #include "fggl/gfx/camera.hpp" #include "fggl/gfx/phong.hpp" -#include "fggl/input/camera_input.h" -#include "fggl/util/service.h" +#include "fggl/input/camera_input.hpp" +#include "fggl/util/service.hpp" #include "fggl/ecs3/prototype/loader.hpp" #include "fggl/debug/draw.hpp" diff --git a/demo/include/GameScene.h b/demo/include/GameScene.h index 521584e8a9a9bb48c5f49bea408329d4e7ab3054..db20119d61e2b216aac2511124830d79162b9fff 100644 --- a/demo/include/GameScene.h +++ b/demo/include/GameScene.h @@ -29,14 +29,14 @@ #include "fggl/gui/gui.hpp" #include "fggl/scenes/game.hpp" -#include "fggl/data/heightmap.h" +#include "fggl/data/heightmap.hpp" #include "fggl/data/procedural.hpp" #include "fggl/gfx/camera.hpp" #include "fggl/input/input.hpp" -#include "fggl/input/camera_input.h" +#include "fggl/input/camera_input.hpp" -#include "fggl/util/service.h" +#include "fggl/util/service.hpp" #include "fggl/util/chrono.hpp" #include "PerlinNoise.hpp" diff --git a/fggl/CMakeLists.txt b/fggl/CMakeLists.txt index 7beae95331515336625b9bc6b1bff76c4cdc8da6..d8271d52aa222f4b993dbb8ea8cc2fbc99c71d13 100644 --- a/fggl/CMakeLists.txt +++ b/fggl/CMakeLists.txt @@ -1,18 +1,16 @@ - - # headers file(GLOB_RECURSE HEADER_LIST CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/include/fggl/**.hpp") - # the fggl library itself +# Should be shared linkage for legal reasons (LGPL) add_library(fggl SHARED ${HEADER_LIST}) # we need to tell people using the library about our headers target_include_directories(fggl - PUBLIC + PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include> - ) +) # users of this library need at least C++20 target_compile_features(fggl PUBLIC cxx_std_20) @@ -34,7 +32,7 @@ if (CLANG_TIDY_FOUND) endif () target_sources(${PROJECT_NAME} - PRIVATE + PRIVATE app.cpp data/model.cpp @@ -57,10 +55,9 @@ target_sources(${PROJECT_NAME} gui/widgets.cpp gui/containers.cpp gui/fonts.cpp +) - math/triangulation.cpp - math/shapes.cpp - ) +add_subdirectory(math) # yaml-cpp for configs and storage find_package(yaml-cpp) diff --git a/fggl/app.cpp b/fggl/app.cpp index 27e5eadcc984e3ebee978f21372dced5ab73bade..419145c49b4402cb4d2e72579b5c26193613d44a 100644 --- a/fggl/app.cpp +++ b/fggl/app.cpp @@ -6,8 +6,8 @@ #include <fggl/app.hpp> #include <fggl/ecs3/types.hpp> -#include <fggl/ecs3/module/module.h> -#include <fggl/util/service.h> +#include "fggl/ecs3/module/module.hpp" +#include <fggl/util/service.hpp> namespace fggl { diff --git a/fggl/audio/openal/audio.cpp b/fggl/audio/openal/audio.cpp index 6afd5402cc69bb5d0f458a5f30537b0977a73778..ed0101d8994261c40ad30e5674da040e23845e7f 100644 --- a/fggl/audio/openal/audio.cpp +++ b/fggl/audio/openal/audio.cpp @@ -21,7 +21,7 @@ #include "fggl/audio/openal/audio.hpp" -#include "fggl/util/service.h" +#include "fggl/util/service.hpp" #include "fggl/data/storage.hpp" namespace fggl::audio::openal { diff --git a/fggl/data/heightmap.cpp b/fggl/data/heightmap.cpp index 525e886d02a9e6996e16ad27bdd1db6a93dc7c9a..7c50f02e489531745b309e524defd6334c6cee9b 100644 --- a/fggl/data/heightmap.cpp +++ b/fggl/data/heightmap.cpp @@ -3,7 +3,7 @@ // #include <fggl/data/model.hpp> -#include <fggl/data/heightmap.h> +#include <fggl/data/heightmap.hpp> // adapted from https://www.mbsoftworks.sk/tutorials/opengl4/016-heightmap-pt1-random-terrain/ diff --git a/fggl/ecs3/fast/Container.cpp b/fggl/ecs3/fast/Container.cpp index 7941260d57536ee01e51f66f22419832105df7e5..75c3a2a590fd98caef7af8e64d9ebf138f2349c2 100644 --- a/fggl/ecs3/fast/Container.cpp +++ b/fggl/ecs3/fast/Container.cpp @@ -2,7 +2,7 @@ // Created by webpigeon on 23/10/2021. // -#include <fggl/ecs3/fast/Container.h> +#include <fggl/ecs3/fast/Container.hpp> namespace fggl::ecs3 { diff --git a/fggl/ecs3/module/module.cpp b/fggl/ecs3/module/module.cpp index 85ce2e5e8e67a1ea1150bc6d2693bd0b5863ebce..ac82f75d125b82d39ee5c8674cfe09ffa86d1c81 100644 --- a/fggl/ecs3/module/module.cpp +++ b/fggl/ecs3/module/module.cpp @@ -2,7 +2,7 @@ // Created by webpigeon on 23/10/2021. // -#include <fggl/ecs3/module/module.h> +#include "fggl/ecs3/module/module.hpp" namespace fggl::ecs3 { diff --git a/fggl/ecs3/prototype/world.cpp b/fggl/ecs3/prototype/world.cpp index 4862f0ed0644771ae952f08164fd6c91566f6295..b9c426c999317018702b8e95a659a2e81e026612 100644 --- a/fggl/ecs3/prototype/world.cpp +++ b/fggl/ecs3/prototype/world.cpp @@ -2,4 +2,4 @@ // Created by webpigeon on 23/10/2021. // -#include <fggl/ecs3/prototype/world.h> +#include <fggl/ecs3/prototype/world.hpp> diff --git a/fggl/gfx/ogl/CMakeLists.txt b/fggl/gfx/ogl/CMakeLists.txt index 8dbb2f0d0fe913bb1f4f9d4a7e80d6cee12d8418..9e40c864cd707606244f95824df226118d375807 100644 --- a/fggl/gfx/ogl/CMakeLists.txt +++ b/fggl/gfx/ogl/CMakeLists.txt @@ -9,11 +9,6 @@ target_sources(fggl types.cpp ) -# Math -# probably shouldn't be graphics dependent... -find_package( glm REQUIRED ) -target_link_libraries(${PROJECT_NAME} PRIVATE glm::glm ) - # OpenGL Backend if ( WIN32 ) message("There is a hack to make opengl detection work on windows, someone should look into this...") diff --git a/fggl/gfx/ogl/renderer.cpp b/fggl/gfx/ogl/renderer.cpp index c713cba9cd3fd8f4618c90a2ebb5ec45c5f131e7..cd123f38f9320a54b29078ab266988dbef0b17a6 100644 --- a/fggl/gfx/ogl/renderer.cpp +++ b/fggl/gfx/ogl/renderer.cpp @@ -1,4 +1,4 @@ -#include <fggl/util/service.h> +#include <fggl/util/service.hpp> #include "fggl/debug/logging.hpp" #include "fggl/gfx/ogl/common.hpp" diff --git a/fggl/gfx/ogl4/canvas.cpp b/fggl/gfx/ogl4/canvas.cpp index c106c02e1d7e34b78b562ba185c9c3c1df2c9347..7e9ce02cacaf7c13371502b80564c06814b51cf5 100644 --- a/fggl/gfx/ogl4/canvas.cpp +++ b/fggl/gfx/ogl4/canvas.cpp @@ -26,7 +26,7 @@ #include <glm/gtc/type_ptr.hpp> #include "fggl/math/triangulation.hpp" -#include "fggl/util/service.h" +#include "fggl/util/service.hpp" #include "fggl/gui/fonts.hpp" #include "fggl/gfx/windowing.hpp" diff --git a/fggl/gfx/ogl4/models.cpp b/fggl/gfx/ogl4/models.cpp index 3af53292cfd596b8dacfeed9e1dfe4621fdd07c8..ff456b06ccc41cbdb125388cbab469e7b6e28937 100644 --- a/fggl/gfx/ogl4/models.cpp +++ b/fggl/gfx/ogl4/models.cpp @@ -23,7 +23,7 @@ // #include "fggl/gfx/ogl4/models.hpp" -#include "fggl/data/heightmap.h" +#include "fggl/data/heightmap.hpp" #include "fggl/gfx/camera.hpp" #include "fggl/gfx/phong.hpp" diff --git a/fggl/input/camera_input.cpp b/fggl/input/camera_input.cpp index bdfffcdf65fa552eea6e36f47c028a26667d3caa..77a7ba0227d9fcb37a428e4b989507aa2314c2a9 100644 --- a/fggl/input/camera_input.cpp +++ b/fggl/input/camera_input.cpp @@ -6,7 +6,7 @@ #include <fggl/input/input.hpp> #include <fggl/gfx/camera.hpp> -#include <fggl/input/camera_input.h> +#include <fggl/input/camera_input.hpp> namespace fggl::input { diff --git a/fggl/math/CMakeLists.txt b/fggl/math/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..85eebe09451086e7d0ca9a687ecb85daf317a832 --- /dev/null +++ b/fggl/math/CMakeLists.txt @@ -0,0 +1,9 @@ +# math +find_package( glm REQUIRED ) +target_link_libraries( fggl PUBLIC glm::glm ) + +target_sources(fggl + PRIVATE + shapes.cpp + triangulation.cpp +) \ No newline at end of file diff --git a/fggl/phys/bullet/CMakeLists.txt b/fggl/phys/bullet/CMakeLists.txt index afeed6441693c7f142f7c21b3011a2c8e7e67870..f422e9c2ecc87d8f6dcafdbf5ee4b68fcda5ae72 100644 --- a/fggl/phys/bullet/CMakeLists.txt +++ b/fggl/phys/bullet/CMakeLists.txt @@ -1,13 +1,16 @@ # bullet integration support +find_package( Bullet ) +if ( NOT Bullet_FOUND ) + message("Bullet not found - disabling bullet physics integration") +else() + target_link_libraries(fggl PUBLIC ${BULLET_LIBRARIES}) + target_include_directories(fggl PUBLIC ${BULLET_INCLUDE_DIR}) -find_package( Bullet REQUIRED ) -target_link_libraries(fggl PUBLIC ${BULLET_LIBRARIES} ) -target_include_directories(fggl PUBLIC ${BULLET_INCLUDE_DIR}) - -# -target_sources(fggl + # bullet cpp files + target_sources(fggl PRIVATE simulation.cpp phys_draw.cpp -) + ) +endif() diff --git a/fggl/scenes/game.cpp b/fggl/scenes/game.cpp index b2f3ad583a62e6d4d95cee1720429a308d4a4cd1..1e30f5da34383e5470d56ff6af4097e9d612ad4c 100644 --- a/fggl/scenes/game.cpp +++ b/fggl/scenes/game.cpp @@ -23,7 +23,7 @@ // #include "fggl/scenes/game.hpp" -#include "fggl/util/service.h" +#include "fggl/util/service.hpp" #include "fggl/phys/bullet/types.hpp" namespace fggl::scenes { diff --git a/fggl/scenes/menu.cpp b/fggl/scenes/menu.cpp index b0437c3c2b84635afa4eb3c00cf49616efa486e5..0da4fc3b5e5a5a9d7b1d7dde687010233f4be513 100644 --- a/fggl/scenes/menu.cpp +++ b/fggl/scenes/menu.cpp @@ -1,5 +1,5 @@ #include <fggl/scenes/menu.hpp> -#include <fggl/util/service.h> +#include <fggl/util/service.hpp> #include <fggl/gui/gui.hpp> #include <spdlog/spdlog.h> diff --git a/include/fggl/app.hpp b/include/fggl/app.hpp index 4ba1ca905c6b4f7440838e53b7d085bae587f86b..a807ede21a46fefe636d5c0072b8a1e5d9d729dc 100644 --- a/include/fggl/app.hpp +++ b/include/fggl/app.hpp @@ -29,7 +29,7 @@ #include <unordered_map> #include <fggl/ecs3/types.hpp> -#include <fggl/ecs3/module/module.h> +#include "fggl/ecs3/module/module.hpp" #include <fggl/gfx/window.hpp> #include <fggl/gfx/paint.hpp> #include <fggl/util/states.hpp> diff --git a/include/fggl/data/heightmap.h b/include/fggl/data/heightmap.hpp similarity index 100% rename from include/fggl/data/heightmap.h rename to include/fggl/data/heightmap.hpp diff --git a/include/fggl/ecs3/ecs.hpp b/include/fggl/ecs3/ecs.hpp index 20e11656a4332c3b9bc1cd6ac28df967061f4ea5..25c64afbe864bba393fa7beaaa9b799532871c90 100644 --- a/include/fggl/ecs3/ecs.hpp +++ b/include/fggl/ecs3/ecs.hpp @@ -1,8 +1,8 @@ #ifndef FGGL_ECS3_ECS_H #define FGGL_ECS3_ECS_H -#include <fggl/ecs3/module/module.h> -#include <fggl/ecs3/prototype/world.h> +#include "fggl/ecs3/module/module.hpp" +#include <fggl/ecs3/prototype/world.hpp> #include <fggl/math/types.hpp> namespace fggl::ecs3 { diff --git a/include/fggl/ecs3/fast/Container.h b/include/fggl/ecs3/fast/Container.hpp similarity index 100% rename from include/fggl/ecs3/fast/Container.h rename to include/fggl/ecs3/fast/Container.hpp diff --git a/include/fggl/ecs3/fast/ecs.hpp b/include/fggl/ecs3/fast/ecs.hpp index 542106c19c9e62e1ecd9a6e08fa7fbc25add5573..425f7d90c1314f28df77dd323b01b97cea4887ea 100644 --- a/include/fggl/ecs3/fast/ecs.hpp +++ b/include/fggl/ecs3/fast/ecs.hpp @@ -13,7 +13,7 @@ #include <fggl/ecs3/utils.hpp> #include <fggl/ecs3/types.hpp> -#include <fggl/ecs3/fast/Container.h> +#include <fggl/ecs3/fast/Container.hpp> namespace fggl::ecs3::fast { diff --git a/include/fggl/ecs3/module/module.h b/include/fggl/ecs3/module/module.hpp similarity index 100% rename from include/fggl/ecs3/module/module.h rename to include/fggl/ecs3/module/module.hpp diff --git a/include/fggl/ecs3/prototype/world.h b/include/fggl/ecs3/prototype/world.hpp similarity index 98% rename from include/fggl/ecs3/prototype/world.h rename to include/fggl/ecs3/prototype/world.hpp index 87a6d66b2e0c1c2f5f8b28572d54aa77833ffdd0..88e78140099ea2d5591e3eadf21fd5c8f0e63239 100644 --- a/include/fggl/ecs3/prototype/world.h +++ b/include/fggl/ecs3/prototype/world.hpp @@ -2,8 +2,8 @@ // Created by webpigeon on 23/10/2021. // -#ifndef FGGL_ECS3_PROTOTYPE_WORLD_H -#define FGGL_ECS3_PROTOTYPE_WORLD_H +#ifndef FGGL_ECS3_PROTOTYPE_WORLD_HPP +#define FGGL_ECS3_PROTOTYPE_WORLD_HPP #include <map> #include <functional> @@ -364,4 +364,4 @@ namespace fggl::ecs3::prototype { } -#endif //FGGL_ECS3_PROTOTYPE_WORLD_H +#endif //FGGL_ECS3_PROTOTYPE_WORLD_HPP diff --git a/include/fggl/gfx/ogl/compat.hpp b/include/fggl/gfx/ogl/compat.hpp index fc50420ee643f21d92695c292479e1e287ca4e0d..7542616f3ceff4336046b343493d505a9fa3823a 100644 --- a/include/fggl/gfx/ogl/compat.hpp +++ b/include/fggl/gfx/ogl/compat.hpp @@ -19,8 +19,8 @@ #include <fggl/gfx/camera.hpp> #include <fggl/ecs/ecs.hpp> #include <utility> -#include <fggl/input/camera_input.h> -#include <fggl/data/heightmap.h> +#include <fggl/input/camera_input.hpp> +#include <fggl/data/heightmap.hpp> #include "fggl/gfx/phong.hpp" diff --git a/include/fggl/gui/fonts.hpp b/include/fggl/gui/fonts.hpp index 370a3ec15b8dae2c605e2109a6b7e7f76b1f4e00..0b1f6156ab63e454fb6dd98effefe903b99e33b5 100644 --- a/include/fggl/gui/fonts.hpp +++ b/include/fggl/gui/fonts.hpp @@ -31,7 +31,7 @@ #include "fggl/math/types.hpp" #include "fggl/data/storage.hpp" -#include "fggl/util/service.h" +#include "fggl/util/service.hpp" #include <ft2build.h> #include FT_FREETYPE_H diff --git a/include/fggl/input/camera_input.h b/include/fggl/input/camera_input.hpp similarity index 100% rename from include/fggl/input/camera_input.h rename to include/fggl/input/camera_input.hpp diff --git a/include/fggl/phys/bullet/bullet.hpp b/include/fggl/phys/bullet/bullet.hpp index b50326c6f321454cb66f6b5ef3f962e033cf7832..df0c2586c0e9c51862cebe9e9174fb6a1948ed64 100644 --- a/include/fggl/phys/bullet/bullet.hpp +++ b/include/fggl/phys/bullet/bullet.hpp @@ -25,7 +25,7 @@ #ifndef FGGL_PHYS_BULLET_BULLET_HPP #define FGGL_PHYS_BULLET_BULLET_HPP -#include "fggl/ecs3/module/module.h" +#include "fggl/ecs3/module/module.hpp" #include "fggl/phys/types.hpp" #include "fggl/phys/bullet/types.hpp" diff --git a/include/fggl/scenes/Scene.h b/include/fggl/scenes/Scene.hpp similarity index 100% rename from include/fggl/scenes/Scene.h rename to include/fggl/scenes/Scene.hpp diff --git a/include/fggl/util/service.h b/include/fggl/util/service.hpp similarity index 100% rename from include/fggl/util/service.h rename to include/fggl/util/service.hpp