Skip to content

Conversation

yuiseki
Copy link
Collaborator

@yuiseki yuiseki commented Aug 30, 2025

Description

This pull request introduces a new OpenGL zero-copy rendering path for Slint integration, primarily targeting Windows, and scaffolds the necessary build system and code changes to enable and experiment with this feature. It adds new CMake options for controlling Slint's renderer features, updates platform-specific build logic, and implements a new C++ module for OpenGL integration. The example app is updated to allow runtime selection between CPU and OpenGL rendering paths via environment variables, and new documentation and formatting helper scripts are provided.

OpenGL Zero-Copy Rendering Integration:

  • Added new C++ module src/slint_maplibre_gl.hpp and corresponding implementation to provide a zero-copy OpenGL rendering pipeline for Slint, including a SlintZeroCopyGL manager and a new SlintMapLibreGL backend/controller. This enables efficient GPU-based map rendering with Slint on supported platforms.
  • Updated examples/main.cpp to support runtime switching between CPU and OpenGL rendering paths using the MLNS_USE_GL environment variable, with appropriate setup of Slint renderer backends and event wiring for both paths.

Build System and Platform Support:

  • Enhanced CMakeLists.txt with new options (MLNS_WITH_SLINT_GL, MLNS_FORCE_FETCH_SLINT) to control OpenGL path and Slint fetching, and configured Slint renderer features (Skia/OpenGL) on Windows. Added logic to build and link the new OpenGL integration library when enabled. Improved platform-specific handling for OpenGL vs. GLES across Windows, macOS, and Linux. [1] [2] [3] [4]

Developer Workflow and Documentation:

  • Updated Windows build guide (docs/build_guides/Windows_11.md) to document new build flags, usage of the OpenGL path, and runtime environment variable for selecting the rendering backend. [1] [2] [3]
  • Improved C++ formatting instructions in AGENTS.md and added a new helper script scripts/format-cpp.sh for consistent code style, now excluding additional build directories. [1] [2]

Todos

  • Tests
  • Documentation
  • Changelog Entry (if applicable)

Screenshots

(If applicable, screenshots of the changes)

@yuiseki yuiseki self-assigned this Aug 31, 2025
@yuiseki yuiseki added the enhancement New feature or request label Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant