Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -235,4 +234,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: react-native-apk
path: app-latest.apk
path: app-latest.apk
5 changes: 1 addition & 4 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
"cacheVariables": {
"DESKTOP_DEBUG_CONSOLE": true
},
"environment": {
"TRIPLET": "x64-windows"
},
"inherits": "desktop"
}
],
Expand Down
6 changes: 6 additions & 0 deletions plugins/AudioVisualizer/desktop/AudioVisualizerDesktop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::unique_ptr<UdpPacket, void (*)(UdpPacket *)> > AudioVisualizerDesktop::compute_next_packet(
const std::string sceneName) {
#ifndef _WIN32
Expand Down
1 change: 1 addition & 0 deletions plugins/AudioVisualizer/desktop/AudioVisualizerDesktop.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions plugins/Shadertoy/desktop/ShadertoyDesktop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
1 change: 1 addition & 0 deletions plugins/Shadertoy/desktop/ShadertoyDesktop.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions shared/desktop/include/shared/desktop/plugin/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
19 changes: 10 additions & 9 deletions src_desktop/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
std::string get_noto_color_emoji_path() {
std::string result;
const char* cmd = "fc-list :family=file | grep -i 'Noto Color Emoji' | awk -F: '{print $1}' | head -n 1";
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);

Check warning on line 52 in src_desktop/main.cpp

View workflow job for this annotation

GitHub Actions / build (desktop-linux, ubuntu-latest, desktop-linux, desktop-linux-build, desktop_build/led-matrix...

ignoring attributes on template argument ‘int (*)(FILE*)’ [-Wignored-attributes]
if (!pipe) return result;
char buffer[512];
if (fgets(buffer, sizeof(buffer), pipe.get())) {
Expand Down Expand Up @@ -110,15 +110,6 @@
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));
}
Expand Down Expand Up @@ -214,7 +205,7 @@
const std::string stateStr = ws->getReadyStateString();
std::string statusText = "WebSocket is currently: " + stateStr;

ImGui::Text(statusText.c_str());

Check warning on line 208 in src_desktop/main.cpp

View workflow job for this annotation

GitHub Actions / build (desktop-linux, ubuntu-latest, desktop-linux, desktop-linux-build, desktop_build/led-matrix...

format not a string literal and no format arguments [-Wformat-security]
if (state != ix::ReadyState::Open) {
if (ImGui::Button("Connect", ImVec2(0, 0))) {
ws->setUrl(fmt::format("ws://{}:{}/desktopWebsocket", hostname, port));
Expand All @@ -233,7 +224,7 @@
}
}

ImGui::Text(("Active Scene: " + ws->getActiveScene()).c_str());

Check warning on line 227 in src_desktop/main.cpp

View workflow job for this annotation

GitHub Actions / build (desktop-linux, ubuntu-latest, desktop-linux, desktop-linux-build, desktop_build/led-matrix...

format not a string literal and no format arguments [-Wformat-security]
auto last = ws->getLastError();
if (!last.empty()) {
ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), "Last Error: %s", last.c_str());
Expand Down Expand Up @@ -398,6 +389,16 @@
}
};
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);
Expand Down
Loading