From 5577a320f16d9c57a1db386d2f3d94e4c6075aa6 Mon Sep 17 00:00:00 2001 From: Davide Faconti Date: Wed, 21 Jan 2026 22:48:02 +0100 Subject: [PATCH 1/3] Fix CI failures on Linux, macOS, and Windows - Linux: Remove qt5-default package from workflow (deprecated in Ubuntu 24.04, qtbase5-dev is sufficient) - macOS/Windows: Add (void) casts to silence unused parameter warnings in plot_exporter.cpp for non-GL backends (-Werror was treating these as errors) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/linux.yml | 1 - src/plot_exporter.cpp | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 48ecca0..b8f61ca 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -24,7 +24,6 @@ jobs: libx11-dev \ libxi-dev \ libxcursor-dev \ - qt5-default \ qtbase5-dev - name: Configure CMake diff --git a/src/plot_exporter.cpp b/src/plot_exporter.cpp index 161f63f..b0de817 100644 --- a/src/plot_exporter.cpp +++ b/src/plot_exporter.cpp @@ -263,6 +263,10 @@ struct PlotExporter::Impl { return true; #else + // Silence unused parameter warnings for non-GL backends + (void)filename; + (void)is_jpeg; + (void)quality; std::fprintf(stderr, "PlotExporter: Not implemented for this graphics backend\n"); return false; #endif From 3d3b2a6bd1b5513d0eab8c03114461271ff24715 Mon Sep 17 00:00:00 2001 From: Davide Faconti Date: Wed, 21 Jan 2026 22:53:20 +0100 Subject: [PATCH 2/3] Fix macOS test compilation: Set OBJCXX for sokol_impl_stub.cpp On macOS, sokol_impl_stub.cpp needs to be compiled as Objective-C++ because Sokol headers include Metal/Foundation frameworks which use Objective-C syntax (@class, @protocol, etc.). Co-Authored-By: Claude Opus 4.5 --- tests/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bef5d02..3fd2fde 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -62,6 +62,11 @@ add_executable(test_tick_label_formatter test_tick_label_formatter.cpp) target_link_libraries(test_tick_label_formatter PRIVATE GTest::gtest_main splot) gtest_discover_tests(test_tick_label_formatter) +# On macOS, sokol_impl_stub.cpp needs to be compiled as Objective-C++ for Metal backend +if(APPLE) + set_source_files_properties(sokol_impl_stub.cpp PROPERTIES LANGUAGE OBJCXX) +endif() + # PlotLegend tests (requires Sokol implementation stub for linking) add_executable(test_plot_legend test_plot_legend.cpp sokol_impl_stub.cpp) target_link_libraries(test_plot_legend PRIVATE GTest::gtest_main splot ${SOKOL_PLATFORM_LIBS}) From bd2bc7a2412dc5b9dc404f5c6e6145567fe62fff Mon Sep 17 00:00:00 2001 From: Davide Faconti Date: Wed, 21 Jan 2026 22:58:11 +0100 Subject: [PATCH 3/3] Fix Qt example black screen: Use QOpenGLWidget's FBO QOpenGLWidget uses its own internal framebuffer object, not the default framebuffer (0). Sokol was rendering to FBO 0 while Qt was displaying from its internal FBO, causing a black screen. The fix sets pass.swapchain.gl.framebuffer to defaultFramebufferObject() so Sokol renders to Qt's FBO. Co-Authored-By: Claude Opus 4.5 --- qt/src/qsplot_widget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qt/src/qsplot_widget.cpp b/qt/src/qsplot_widget.cpp index 56c1522..cd48ef3 100644 --- a/qt/src/qsplot_widget.cpp +++ b/qt/src/qsplot_widget.cpp @@ -238,7 +238,7 @@ void QSplotWidget::paintGL() { const int fbWidth = static_cast(width() * dpr); const int fbHeight = static_cast(height() * dpr); - // Begin pass with Qt's default framebuffer + // Begin pass with Qt's framebuffer (NOT 0 - QOpenGLWidget has its own FBO) sg_pass_action pass_action{}; pass_action.colors[0].load_action = SG_LOADACTION_CLEAR; pass_action.colors[0].clear_value = {impl_->bgR, impl_->bgG, impl_->bgB, impl_->bgA}; @@ -250,6 +250,8 @@ void QSplotWidget::paintGL() { pass.swapchain.sample_count = 1; pass.swapchain.color_format = SG_PIXELFORMAT_RGBA8; pass.swapchain.depth_format = SG_PIXELFORMAT_DEPTH_STENCIL; + // CRITICAL: QOpenGLWidget uses its own FBO, not the default (0) + pass.swapchain.gl.framebuffer = defaultFramebufferObject(); sg_begin_pass(pass); // Call the render callback if set