From 25b9e06c0e64d6db43d1ea715e0a9386afa42481 Mon Sep 17 00:00:00 2001 From: Ivan Gagis Date: Thu, 19 Nov 2026 04:46:09 +0200 Subject: [PATCH] main: create a render factory and pass it to the context Follow-up to ruis issue #190: the SDL example now creates a shared render factory and passes it into the per-window context and the resource loader. --- src/main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c7dea66..ae3beca 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -357,14 +358,15 @@ int main(int argc, char* args[]) return 1; } - auto rendering_context = - utki::make_shared(utki::make_shared()); + auto render_native_window = utki::make_shared(); + auto rendering_factory = utki::make_shared(render_native_window); + auto rendering_context = utki::make_shared(render_native_window, rendering_factory); - auto common_render_objects = utki::make_shared(rendering_context); - auto common_shaders = rendering_context.get().make_shaders(); + auto common_render_objects = utki::make_shared(rendering_factory.get()); + auto common_shaders = rendering_factory.get().make_shaders(); auto ruis_resource_loader = utki::make_shared( - rendering_context, // + rendering_factory, // common_render_objects );