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
1 change: 0 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
libx11-dev \
libxi-dev \
libxcursor-dev \
qt5-default \
qtbase5-dev

- name: Configure CMake
Expand Down
4 changes: 3 additions & 1 deletion qt/src/qsplot_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void QSplotWidget::paintGL() {
const int fbWidth = static_cast<int>(width() * dpr);
const int fbHeight = static_cast<int>(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};
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/plot_exporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down