diff --git a/build-aux/com.fossgalaxy.fggl.demo.yml b/build-aux/com.fossgalaxy.fggl.demo.yml index c5194b7438cd4c3a19f1784ce672cf3e8c9af48e..a25a073556cd55c57bd0149842d2d9e819d2c89c 100644 --- a/build-aux/com.fossgalaxy.fggl.demo.yml +++ b/build-aux/com.fossgalaxy.fggl.demo.yml @@ -1,8 +1,13 @@ -app-id: com.fossgalaxy.fggl.demo -runtime: org.freedesktop.Platform.GL.default +app-id: com.fossgalaxy.fggl.Demo +runtime: org.freedesktop.Platform runtime-version: '21.08' sdk: org.freedesktop.Sdk -command: fggl-demo +command: /app/bin/demo +finish-args: + - "--device=dri" + - "--share=ipc" + - "--socket=fallback-x11" + - "--socket=wayland" modules: - name: glfw buildsystem: cmake-ninja @@ -13,13 +18,24 @@ modules: sha256: bbd2c42c660b725e9755eb417e40b373f0d4c03138c9b2e210d02cd308bd99cd cleanup: - /include + - /lib/cmake - /lib/pkgconfig + - '*.a' - modules/glm-0.9.9.8.json - - shared-modules/glew/glew.json + - modules/fmt.yml + - modules/spdlog.json + # - shared-modules/glew/glew.json + # - modules/googletest.yml - shared-modules/glu/glu-9.json - - modules/googletest.yml + - modules/yaml-cpp.yml + - modules/assimp.yml - name: fggl buildsystem: cmake + builddir: true sources: - type: dir path: ../ + cleanup: + - '/include' + - '/cmake' + - '*.a' diff --git a/build-aux/modules/assimp.yml b/build-aux/modules/assimp.yml new file mode 100644 index 0000000000000000000000000000000000000000..dd6c1bbb12e8515a8413086b51fe859815487048 --- /dev/null +++ b/build-aux/modules/assimp.yml @@ -0,0 +1,13 @@ +name: assimp +buildsystem: cmake +config-opts: + - -DASSIMP_BUILD_ASSIMP_TOOLS=OFF + - -DASSIMP_BUILD_TESTS=OFF +sources: + - type: git + url: https://github.com/assimp/assimp.git + tag: v5.2.4 +cleanup: + - '/include' + - '/lib/cmake' + - '/lib/pkgconfig' diff --git a/build-aux/modules/fmt.yml b/build-aux/modules/fmt.yml new file mode 100644 index 0000000000000000000000000000000000000000..ba04d4ff485dc31bb196c7f050e942e18563c407 --- /dev/null +++ b/build-aux/modules/fmt.yml @@ -0,0 +1,11 @@ +name: fmt +buildsystem: cmake +sources: + - type: git + url: https://github.com/fmtlib/fmt.git + tag: 8.1.1 +cleanup: + - '/include' + - '/lib/cmake' + - '/lib/pkgconfig' + - '*.a' diff --git a/build-aux/modules/googletest.yml b/build-aux/modules/googletest.yml index 5c47899901e477a57393e18c8784e5a615fea806..96e345e9c51fe6fd7b860a9d0d205127f7c0e907 100644 --- a/build-aux/modules/googletest.yml +++ b/build-aux/modules/googletest.yml @@ -4,3 +4,8 @@ sources: - type: archive url: https://github.com/google/googletest/archive/refs/tags/release-1.11.0.zip sha256: 353571c2440176ded91c2de6d6cd88ddd41401d14692ec1f99e35d013feda55a +cleanup: + - '/include' + - '/lib/cmake' + - '/lib/pkgconfig' + - '*.a' diff --git a/build-aux/modules/spdlog.json b/build-aux/modules/spdlog.json new file mode 100644 index 0000000000000000000000000000000000000000..ae311535b156010f8a6a8bfcc3afe6ed2ea34c92 --- /dev/null +++ b/build-aux/modules/spdlog.json @@ -0,0 +1,17 @@ +{ + "name": "spdlog", + "buildsystem": "cmake", + "sources": [ + { + "type": "git", + "url": "https://github.com/gabime/spdlog.git", + "tag": "v1.10.0" + } + ], + "cleanup": [ + "/include", + "/lib/cmake", + "/lib/pkgconfig", + "*.a" + ] +} diff --git a/build-aux/modules/yaml-cpp.yml b/build-aux/modules/yaml-cpp.yml new file mode 100644 index 0000000000000000000000000000000000000000..1b394f479a7e3fc36fa59daf95d8a885b805c879 --- /dev/null +++ b/build-aux/modules/yaml-cpp.yml @@ -0,0 +1,13 @@ +name: yaml-cpp +buildsystem: cmake +config-opts: + - -DYAML_CPP_BUILD_TESTS=off +sources: + - type: git + url: https://github.com/jbeder/yaml-cpp.git + tag: yaml-cpp-0.7.0 +cleanup: + - '/include' + - '/share/cmake' + - '/share/pkgconfig' + - '*.a' diff --git a/build-aux/shared-modules b/build-aux/shared-modules index 0534d3276b3966e87abacd163f757454b6fcf724..1bb53934f105743f84f923693847185dce613cef 160000 --- a/build-aux/shared-modules +++ b/build-aux/shared-modules @@ -1 +1 @@ -Subproject commit 0534d3276b3966e87abacd163f757454b6fcf724 +Subproject commit 1bb53934f105743f84f923693847185dce613cef diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index 27ae4180c0106f017e390fb8a3156700e7d96b06..8ef5eced8e90f07ae52934fdc6ef00816a4d8b53 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -31,6 +31,12 @@ install( DESTINATION ${CMAKE_INSTALL_BINDIR} ) install( - DIRECTORY data - DESTINATION ${CMAKE_INSTALL_DATADIR} + DIRECTORY data/ + DESTINATION ${CMAKE_INSTALL_DATADIR}/fggl-demo ) + +# Linux Desktop Entries +if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + install(FILES aux/com.fossgalaxy.fggl.Demo.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications ) + install(FILES aux/com.fossgalaxy.fggl.Demo.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo ) +endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") diff --git a/demo/aux/com.fossgalaxy.fggl.Demo.desktop b/demo/aux/com.fossgalaxy.fggl.Demo.desktop new file mode 100644 index 0000000000000000000000000000000000000000..a99bc59101fcabb2f63e79894ed7aa4906c458a8 --- /dev/null +++ b/demo/aux/com.fossgalaxy.fggl.Demo.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Name=FGGL Demo +Exec=demo +Type=Application +Categories=Game diff --git a/demo/aux/com.fossgalaxy.fggl.Demo.metainfo.xml b/demo/aux/com.fossgalaxy.fggl.Demo.metainfo.xml new file mode 100644 index 0000000000000000000000000000000000000000..dff840b2710071371ecea736adb5e8eb52f66643 --- /dev/null +++ b/demo/aux/com.fossgalaxy.fggl.Demo.metainfo.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component type="desktop-application"> + <id>com.fossgalaxy.fggl.Demo</id> + + <name>FGGL Demo</name> + <summary>An application for testing FGGL features</summary> + + <metadata_license>CC-BY-4.0</metadata_license> + <project_license>GPL-3.0-or-later</project_license> + + <description> + <p> + Test application for the FOSS Galaxy Game Library (FGGL) + </p> + </description> + + <launchable type="desktop-id">com.fossgalaxy.fggl.Demo.desktop</launchable> +</component> diff --git a/fggl/platform/linux/paths.cpp b/fggl/platform/linux/paths.cpp index 2d3564dcd67df56a59e52bc0e40b5d6ab8a4325d..92f1a1a5f31f96a888b5f9401ab5a19f535e987c 100644 --- a/fggl/platform/linux/paths.cpp +++ b/fggl/platform/linux/paths.cpp @@ -19,6 +19,7 @@ #include <cstdlib> #include "fggl/platform/linux/paths.hpp" +#include "fggl/debug/logging.hpp" namespace fggl::platform { @@ -30,7 +31,7 @@ namespace fggl::platform { return {fallback}; } - static std::vector<std::filesystem::path> get_path_list(const char* env) { + static std::vector<std::filesystem::path> get_path_list(const char* env, const char* folderName) { const char* pathList = std::getenv(env); std::vector<std::filesystem::path> paths; if (pathList) { @@ -42,7 +43,7 @@ namespace fggl::platform { nextPos = pathListStr.size(); } std::string path = pathListStr.substr(pos, nextPos - pos); - paths.push_back(std::filesystem::path(path)); + paths.push_back(std::filesystem::path(path) / folderName); pos = nextPos + 1; } } @@ -50,14 +51,14 @@ namespace fggl::platform { } EnginePaths calc_engine_paths(const char* base) { - auto dataDirs = get_path_list(ENV_DATA_DIRS); + auto dataDirs = get_path_list(ENV_DATA_DIRS, base); if ( dataDirs.empty() ) { for ( const auto& defaultDir : DEFAULT_DATA_DIRS ) { dataDirs.push_back(std::filesystem::path(defaultDir) / base ); } } - auto configDirs = get_path_list(ENV_CONFIG_DIRS); + auto configDirs = get_path_list(ENV_CONFIG_DIRS, base); if ( configDirs.empty() ) { for ( const auto& defaultDir : DEFAULT_CONFIG_DIRS ) { configDirs.push_back(std::filesystem::path(defaultDir) / base ); @@ -82,6 +83,7 @@ namespace fggl::platform { // check system paths for ( const auto& path : paths.dataDirs ) { auto fullPath = path / relPath; + debug::log(debug::Level::warning, "Checking data path: {}, {}", fullPath.c_str(), std::filesystem::exists(fullPath)); if ( std::filesystem::exists(fullPath) ) { return fullPath; } diff --git a/include/fggl/assets/types.hpp b/include/fggl/assets/types.hpp index d943d632c6a61216e1809c9d83db574ca0a76b7a..7eb06066466e4ec8d4982c1d7c79f73f4fc9c94d 100644 --- a/include/fggl/assets/types.hpp +++ b/include/fggl/assets/types.hpp @@ -20,6 +20,9 @@ #define FGGL_ASSETS_TYPES_HPP #include <filesystem> +#include <variant> +#include <functional> + #include "fggl/util/safety.hpp" namespace fggl::assets{