From 3fe1343eda020f546f0b3c127307fceb611da057 Mon Sep 17 00:00:00 2001
From: sshcrack <34072808+sshcrack@users.noreply.github.com>
Date: Mon, 4 Aug 2025 01:30:04 +0200
Subject: [PATCH 1/6] Fix crash on desktop app
---
.idea/vcs.xml | 5 +----
CMakeLists.txt | 2 +-
CMakePresets.json | 3 +++
.../desktop/AudioVisualizerDesktop.cpp | 6 ++++++
.../desktop/AudioVisualizerDesktop.h | 1 +
.../Shadertoy/desktop/ShadertoyDesktop.cpp | 6 ++++++
plugins/Shadertoy/desktop/ShadertoyDesktop.h | 1 +
.../include/shared/desktop/plugin/main.h | 5 +----
src_desktop/main.cpp | 19 ++++++++++---------
9 files changed, 30 insertions(+), 18 deletions(-)
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);
From 9dec476c3e34aa6612f52aaf7b08c684e60bcc05 Mon Sep 17 00:00:00 2001
From: Hendrik Lind <34072808+sshcrack@users.noreply.github.com>
Date: Mon, 4 Aug 2025 10:50:33 +0200
Subject: [PATCH 2/6] Update ci.yml
---
.github/workflows/ci.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b2019b69..d293c8ab 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,6 +2,7 @@
name: CI
on:
+ workflow_dispatch:
push:
branches: [master]
pull_request:
From 9122c64fd7d895d7f7500749553618b5dc0cd833 Mon Sep 17 00:00:00 2001
From: Hendrik Lind <34072808+sshcrack@users.noreply.github.com>
Date: Mon, 4 Aug 2025 10:53:10 +0200
Subject: [PATCH 3/6] Update ci.yml
---
.github/workflows/ci.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d293c8ab..4502a4a8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,4 +1,3 @@
-# filepath: .github/workflows/ci.yml
name: CI
on:
From 234cb315532183df93a205f5c761d00419c1597e Mon Sep 17 00:00:00 2001
From: Hendrik Lind <34072808+sshcrack@users.noreply.github.com>
Date: Mon, 4 Aug 2025 13:39:13 +0200
Subject: [PATCH 4/6] Update ci.yml
---
.github/workflows/ci.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4502a4a8..356f0214 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
From 65dc703abb8cfdb4d2a6b19e40bac8efdb7a1b74 Mon Sep 17 00:00:00 2001
From: Hendrik Lind <34072808+sshcrack@users.noreply.github.com>
Date: Mon, 4 Aug 2025 13:40:00 +0200
Subject: [PATCH 5/6] Update ci.yml
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 356f0214..50bc514e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -215,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
From 3251e57b66b9641f451b2ecbcbaccadb8ebf2bf9 Mon Sep 17 00:00:00 2001
From: sshcrack <34072808+sshcrack@users.noreply.github.com>
Date: Mon, 4 Aug 2025 14:43:17 +0200
Subject: [PATCH 6/6] Merge the if keys in 'build-react-native'
---
.github/workflows/ci.yml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 50bc514e..32ee3a21 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,7 +1,7 @@
+# filepath: .github/workflows/ci.yml
name: CI
on:
- workflow_dispatch:
push:
branches: [master]
pull_request:
@@ -183,7 +183,7 @@ jobs:
CROSS_COMPILE_ROOT: ${{ matrix.requires-toolchain && runner.temp }}/cross-compile
build-react-native:
- 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/') }}}}
+ 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
steps:
@@ -215,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
@@ -234,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