Repository navigation
Conversation
Follow-up to ruis issue #190: each platform glue now creates a single shared render factory (the shared/headless render context) in the application constructor and passes it into every per-window context and the resource loader. The shared-context member (resource_loader_ruis_rendering_context) is renamed to render_factory (shared_ref<const factory>) and the common_shaders type becomes factory::shaders.
…ry member Follows the ruis context::factory member -> factory() method change. Refs cppfw/ruis#190
Wire up ruis-render-vulkan as a selectable renderer backend for the Linux Xorg and Wayland backends, built on the shared render factory introduced by the factory refactor (this is the Vulkan integration rebased from the pre-factory 'vulkan' branch onto 'ren_factory'). - Add Vulkan variants of each Linux ruisapp library (ruisapp-vulkan-xorg, ruisapp-vulkan-wayland), built only when the ruis-render-vulkan package is available so the rest of the package keeps working until it is released. - A single shared ruis::render::vulkan::factory (created from a headless surface provider, since Vulkan has no 'current context' and all GPU resources live on the VkDevice) is used for resource loading, shaders and common render objects. - Each window creates its own VkSurface (Xlib or Wayland) plus a per-window vulkan::context bound to that surface and the shared factory. - Add a Vulkan-native window implementation (vulkan_window.hxx) with proper WM_DELETE_WINDOW handling and an XFlush on destroy. - Harden window lifecycle: destroy_window() no longer asserts when the window is already gone, and mouse button events send a move first so the GUI knows the pointer position. Adapted to the factory API: contexts now take the shared factory, and common_shaders/common_render_objects come from the factory.
- Extract graphics-agnostic X11 window base class (xorg_window.hxx): window creation, input, cursor management, display handling. - GL leaf (window.hxx) now uses multiple inheritance: gl_visual_info (FBConfig + visual) + xorg_window (X11 base). - Vulkan leaf (vulkan_window.hxx) simplified to ~80 lines: inherits xorg_window, uses default visual, adds present_func. - Fix Wayland: create_egl_surface() now calls bind_rendering_context() so the EGL surface is bound even when the context is already current.
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
- Remove Vulkan build gating from CMake (always build/export/declare vulkan variants) - Change vulkan_device from unique_ptr to shared_ref (wayland + xorg) - Remove vulkan_surface_provider member, construct null surface locally for factory - Rename window.hxx to opengl_window.hxx - Change negative #ifndef RUISAPP_RENDER_VULKAN to positive conditions - Add explanatory comments (present_func, surface extensions, VU_CHECK, concrete factory, window mapped roundtrip, egl_dummy_surface) - Remove unnecessary curly brackets in ConfigureNotify case - Remove unnecessary send_mouse_move calls in ButtonPress/ButtonRelease - Remove unused destroy_x11_window() from xorg_window - Use ctx().ren().ctx().fac() shortcuts in test app
igagis
commented
Nov 20, 2026
igagis
commented
Nov 20, 2026
- Remove ruisapp_export_targets list, pass targets directly to myci_export() - Capture window by reference instead of raw pointer in close_handler
- Use make_shared for vulkan_device (ctor is now public) - Update surface_provider references to surface - Extract make_vulkan_device() helper (make_shared doesn't work with brace-enclosed initializer lists)
… Wayland window to base + per-API leaves - Split opengl_window.hxx into opengl_window.hxx (GLX) and opengles_window.hxx (EGL) - Create wayland_window.hxx (base), opengles_window.hxx (GLES leaf), vulkan_window.hxx (Vulkan leaf) - Update includes and constructor signatures
…nstead of present_func
…ntext The shared_gl_context_native_window member is a shared_ref (cannot be null). For Vulkan, it was being set to nullptr, causing an assertion failure. Now a 1x1 hidden window is created for all APIs.
…c_cast Create the Vulkan render context before the ruis::context so we can save a pointer to it directly (owner_context) without a static_cast downcast.
- Store concrete factory type (no dynamic_cast needed) - Create render context before ruis::context for all APIs - Rename vulkan_ctx to render_context - Move owner_context assignment to right after render context creation - Remove answered review comments
…indows - window.cpp calls render context's swap_frame_buffers() instead of native window's - Removed owner_context pointer and swap_frame_buffers() override from Vulkan native windows (Xorg + Wayland) — the context handles presentation - xdg_surface.cxx: moved swap_frame_buffers() call out of #ifdef since it is now identical for GL and Vulkan paths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to cppfw/ruis#190 (render context redesign).
Each platform glue (linux xorg/wayland, sdl, ios, android, windows, macos) now creates a single shared render factory (the shared/headless render context) in the application constructor and passes it into every per-window context and the resource loader. The shared-context member (
resource_loader_ruis_rendering_context) is renamed torender_factory(shared_ref<const factory>) and thecommon_shaderstype becomesfactory::shaders.The test app's cube widget is updated to create its geometry via the factory.
Depends on cppfw/ruis#192 and the renderer PRs.