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/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 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 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})