diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..e7cf4f6 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,53 @@ +name: 🍎 macOS + +# TODO: upload *.dylib / *.framework as artifacts + +on: + push: + paths: + - "doc/cpp-demo/**" + branches-ignore: + - godot3 + pull_request: + paths: + - "doc/cpp-demo/**" + branches-ignore: + - godot3 + +env: + VCPKG_ROOT: "${{ github.workspace }}/vcpkg" + VCPKG_DISABLE_METRICS: 1 + vcpkg_tag: "2022.11.14" + source: "${{ github.workspace }}/doc/cpp-demo" + build: "${{ github.workspace }}/doc/cpp-demo/build.debug" + preset: debug + config: Debug + +jobs: + analyze: + name: Build + runs-on: macos-latest + + steps: + - name: macOS deps + run: | + brew install ninja + + - uses: actions/checkout@v3 + + - name: Get vcpkg + run: | + git clone -n https://github.com/microsoft/vcpkg + cd vcpkg + git checkout ${{ env.vcpkg_tag }} + ./bootstrap-vcpkg.sh + + - name: CMake Configure + run: cmake --preset ${{ env.preset }} ${{ env.source }} + + - name: CMake Build + run: cmake --build ${{ env.build }} --config ${{ env.config }} --target install + + - name: CMake Test + working-directory: ${{ env.build }} + run: ctest -C ${{env.config}} diff --git a/doc/cpp-demo/src/MyCppNode.cpp b/doc/cpp-demo/src/MyCppNode.cpp index ed04757..aa4e307 100644 --- a/doc/cpp-demo/src/MyCppNode.cpp +++ b/doc/cpp-demo/src/MyCppNode.cpp @@ -8,6 +8,8 @@ using namespace godot; struct MyCppNode::Impl { + bool show_imgui_demo = true; + bool show_implot_demo = true; }; MyCppNode::MyCppNode() : impl(std::make_unique()) @@ -71,7 +73,11 @@ void MyCppNode::_exit_tree() void MyCppNode::_process(double delta) { - ImPlot::ShowDemoWindow(); + if (impl->show_imgui_demo) + ImGui::ShowDemoWindow(&impl->show_imgui_demo); + + if (impl->show_implot_demo) + ImPlot::ShowDemoWindow(&impl->show_implot_demo); ImGui::Begin("Cpp Window"); ImGui::Text("hello from C++");