diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2019b69..32ee3a21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,10 +183,9 @@ jobs: CROSS_COMPILE_ROOT: ${{ matrix.requires-toolchain && runner.temp }}/cross-compile build-react-native: - if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} + if: ${{ (github.event_name == 'push' || github.event_name == 'pull_request') && (contains(join(github.event.head_commit.modified, ','), 'react-native/') || contains(join(github.event.head_commit.added, ','), 'react-native/') || contains(join(github.event.head_commit.removed, ','), 'react-native/')) }} runs-on: ubuntu-latest # Only run if files in react-native/ changed - if: ${{ contains(join(github.event.head_commit.modified, ','), 'react-native/') || contains(join(github.event.head_commit.added, ','), 'react-native/') || contains(join(github.event.head_commit.removed, ','), 'react-native/') }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -216,7 +215,7 @@ jobs: distribution: 'temurin' java-version: '17' - - name:  Setup EAS + - name: Setup EAS uses: expo/expo-github-action@v8 with: eas-version: latest @@ -235,4 +234,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: react-native-apk - path: app-latest.apk + path: app-latest.apk \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index fca01695..d3e3b6d9 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -5,14 +5,11 @@ + - - - - diff --git a/CMakeLists.txt b/CMakeLists.txt index 229851bd..adf4b4fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ foreach(PLUGIN_NAME ${PLUGIN_DIRS}) endif() endforeach() -project(main VERSION 1.9.0) +project(main VERSION 1.9.1) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") # Define version macros for compile-time access diff --git a/CMakePresets.json b/CMakePresets.json index b986a676..c65b838c 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -55,6 +55,9 @@ "cacheVariables": { "DESKTOP_DEBUG_CONSOLE": true }, + "environment": { + "TRIPLET": "x64-windows" + }, "inherits": "desktop" } ], diff --git a/plugins/AudioVisualizer/desktop/AudioVisualizerDesktop.cpp b/plugins/AudioVisualizer/desktop/AudioVisualizerDesktop.cpp index f1621556..d6ead3a6 100644 --- a/plugins/AudioVisualizer/desktop/AudioVisualizerDesktop.cpp +++ b/plugins/AudioVisualizer/desktop/AudioVisualizerDesktop.cpp @@ -249,6 +249,12 @@ void AudioVisualizerDesktop::addVisualizer() { } } +void AudioVisualizerDesktop::initialize_imgui(ImGuiContext *im_gui_context, ImGuiMemAllocFunc*alloc_fn, + ImGuiMemFreeFunc*free_fn, void **user_data) { + ImGui::SetCurrentContext(im_gui_context); + ImGui::GetAllocatorFunctions(alloc_fn, free_fn, user_data); +} + std::optional > AudioVisualizerDesktop::compute_next_packet( const std::string sceneName) { #ifndef _WIN32 diff --git a/plugins/AudioVisualizer/desktop/AudioVisualizerDesktop.h b/plugins/AudioVisualizer/desktop/AudioVisualizerDesktop.h index 0dbb5d87..fcb7e17d 100644 --- a/plugins/AudioVisualizer/desktop/AudioVisualizerDesktop.h +++ b/plugins/AudioVisualizer/desktop/AudioVisualizerDesktop.h @@ -32,6 +32,7 @@ class AudioVisualizerDesktop final : public Plugins::DesktopPlugin return PLUGIN_NAME; } + void initialize_imgui(ImGuiContext *im_gui_context, ImGuiMemAllocFunc*alloc_fn, ImGuiMemFreeFunc*free_fn, void **user_data) override; private: ImPlotContext *implotContext = nullptr; diff --git a/plugins/Shadertoy/desktop/ShadertoyDesktop.cpp b/plugins/Shadertoy/desktop/ShadertoyDesktop.cpp index 13c055dd..a10183d3 100644 --- a/plugins/Shadertoy/desktop/ShadertoyDesktop.cpp +++ b/plugins/Shadertoy/desktop/ShadertoyDesktop.cpp @@ -59,6 +59,12 @@ void ShadertoyDesktop::after_swap(ImGuiContext *imCtx) currData = data; } +void ShadertoyDesktop::initialize_imgui(ImGuiContext *im_gui_context, ImGuiMemAllocFunc*alloc_fn, + ImGuiMemFreeFunc*free_fn, void **user_data) { + ImGui::SetCurrentContext(im_gui_context); + ImGui::GetAllocatorFunctions(alloc_fn, free_fn, user_data); +} + void ShadertoyDesktop::render() { if (!initError.empty()) diff --git a/plugins/Shadertoy/desktop/ShadertoyDesktop.h b/plugins/Shadertoy/desktop/ShadertoyDesktop.h index 1660b4e3..2a3e30fe 100644 --- a/plugins/Shadertoy/desktop/ShadertoyDesktop.h +++ b/plugins/Shadertoy/desktop/ShadertoyDesktop.h @@ -22,6 +22,7 @@ class ShadertoyDesktop final : public Plugins::DesktopPlugin void post_init() override; void after_swap(ImGuiContext *imCtx) override; + void initialize_imgui(ImGuiContext *im_gui_context, ImGuiMemAllocFunc*alloc_fn, ImGuiMemFreeFunc*free_fn, void **user_data) override; private: int width, height; diff --git a/shared/desktop/include/shared/desktop/plugin/main.h b/shared/desktop/include/shared/desktop/plugin/main.h index ccd3fc5e..e462b69b 100644 --- a/shared/desktop/include/shared/desktop/plugin/main.h +++ b/shared/desktop/include/shared/desktop/plugin/main.h @@ -63,9 +63,6 @@ namespace Plugins return std::nullopt; } - virtual void initialize_imgui(ImGuiContext * im_gui_context, ImGuiMemAllocFunc* alloc_fn, ImGuiMemFreeFunc* free_fn, void** user_data) { - ImGui::SetCurrentContext(im_gui_context); - ImGui::GetAllocatorFunctions(alloc_fn, free_fn, user_data); - } + virtual void initialize_imgui(ImGuiContext * im_gui_context, ImGuiMemAllocFunc* alloc_fn, ImGuiMemFreeFunc* free_fn, void** user_data) = 0; }; } diff --git a/src_desktop/main.cpp b/src_desktop/main.cpp index fdede7f2..53d9c900 100644 --- a/src_desktop/main.cpp +++ b/src_desktop/main.cpp @@ -110,15 +110,6 @@ int main(const int argc, char *argv[]) auto cfg = ConfigManager::instance(); pl->initialize(); - ImGuiMemAllocFunc alloc_fn = nullptr; - ImGuiMemFreeFunc free_fn = nullptr; - void* user_data = nullptr; - - ImGui::GetAllocatorFunctions(&alloc_fn, &free_fn, &user_data); - for(auto &[name, plugin]: pl->get_plugins()) { - plugin->initialize_imgui(ImGui::GetCurrentContext(), &alloc_fn, &free_fn, &user_data); - } - for (const auto &[plName, plugin]: pl->get_plugins()) { plugin->load_config(cfg->getPluginSetting(plName)); } @@ -398,6 +389,16 @@ int main(const int argc, char *argv[]) } }; runnerParams.callbacks.PostInit = [&]() { + ImGuiMemAllocFunc alloc_fn = nullptr; + ImGuiMemFreeFunc free_fn = nullptr; + void* user_data = nullptr; + + ImGui::GetAllocatorFunctions(&alloc_fn, &free_fn, &user_data); + auto context = ImGui::GetCurrentContext(); + for(auto &[name, plugin]: pl->get_plugins()) { + plugin->initialize_imgui(context, &alloc_fn, &free_fn, &user_data); + } + auto *window = (GLFWwindow *) HelloImGui::GetRunnerParams()->backendPointers.glfwWindow; setMainGLFWWindow(window); glfwSwapInterval(0);