diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 07a6788..5b31166 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false - + matrix: os: [ubuntu-latest, windows-2025] build_type: [Release] @@ -21,21 +21,27 @@ jobs: - os: windows-2025 c_compiler: cl cpp_compiler: cl - + vcpkg_triplet: x64-windows + vcpkg_commit_id: 1e199d32ad53aab1defda61ce41c380302e3f95c + - os: ubuntu-latest c_compiler: gcc cpp_compiler: g++ - + vcpkg_triplet: x64-linux + vcpkg_commit_id: 1e199d32ad53aab1defda61ce41c380302e3f95c + - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ + vcpkg_triplet: x64-linux + vcpkg_commit_id: 1e199d32ad53aab1defda61ce41c380302e3f95c exclude: - os: windows-2025 c_compiler: gcc - + - os: windows-2025 c_compiler: clang - + - os: ubuntu-latest c_compiler: cl @@ -48,7 +54,26 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y --no-install-recommends xorg-dev libglu1-mesa-dev + sudo apt-get install -y --no-install-recommends \ + autoconf autoconf-archive automake libtool libltdl-dev \ + build-essential git make pkg-config cmake ninja-build \ + gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev \ + libfribidi-dev libjack-dev libsndio-dev libx11-dev libxext-dev \ + libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev \ + libxtst-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev \ + libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev \ + libudev-dev libthai-dev libpipewire-0.3-dev libwayland-dev \ + libdecor-0-dev liburing-dev + + - name: Setup vcpkg + id: runvcpkg + uses: lukka/run-vcpkg@v11 + with: + vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg' + vcpkgGitCommitId: '${{ matrix.vcpkg_commit_id }}' + + - name: Install SDL3 via vcpkg + run: vcpkg install sdl3:${{ matrix.vcpkg_triplet }} - name: Set reusable strings id: strings @@ -62,6 +87,8 @@ jobs: -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake + -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }} -S ${{ github.workspace }} - name: Build diff --git a/CMakeLists.txt b/CMakeLists.txt index d95b8e6..1fb8a9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,8 @@ option(BUILD_SHARED_LIBS "Build shared libs" ON) # Dependencies # -find_package(SDL3 REQUIRED) +find_package(SDL3 CONFIG REQUIRED) + include(3rdparty/imgui.cmake) include(3rdparty/implot.cmake) diff --git a/src_demo/window_demo.cpp b/src_demo/window_demo.cpp index 62f9c61..c4f1528 100644 --- a/src_demo/window_demo.cpp +++ b/src_demo/window_demo.cpp @@ -15,7 +15,7 @@ // namespace Uni::GUI::Example { - bool WindowDemo::UiUpdate(UiApp& app) { + bool WindowDemo::UiUpdate(UiState& state) { static bool win_about = false; static bool win_demo = false; static bool win_demo_implot = false; @@ -24,7 +24,7 @@ namespace Uni::GUI::Example { ImGui::SetNextWindowSize({800,600}); if (ImGui::Begin("demo")) { - ImGui::Text(std::string(app.GetRenderingApiName()).c_str()); + ImGui::Text("%s", std::string(state.app->GetRenderingApiName()).c_str()); if (ImGui::Button("About")) { diff --git a/src_demo/window_demo.h b/src_demo/window_demo.h index 51aeda5..0aaa117 100644 --- a/src_demo/window_demo.h +++ b/src_demo/window_demo.h @@ -15,7 +15,7 @@ namespace Uni::GUI::Example { class WindowDemo: public Uni::GUI::UiElement { public: explicit WindowDemo() = default; - bool UiUpdate(UiApp&) override; + bool UiUpdate(UiState&) override; }; }