From 2c32196bbc632411d4f6998a506ca262a805a666 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 27 Apr 2026 21:19:56 +0800 Subject: Add global resource system to Program --- mingling_core/src/program.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mingling_core/src/program.rs') diff --git a/mingling_core/src/program.rs b/mingling_core/src/program.rs index 949dd45..1505480 100644 --- a/mingling_core/src/program.rs +++ b/mingling_core/src/program.rs @@ -8,11 +8,15 @@ use crate::error::GeneralRendererSerializeError; use std::env; use crate::{ - AnyOutput, ChainProcess, RenderResult, + AnyOutput, ChainProcess, GlobalResources, RenderResult, asset::dispatcher::Dispatcher, error::{ChainProcessError, ProgramExecuteError}, }; -use std::{fmt::Display, sync::OnceLock}; +use std::{ + collections::HashMap, + fmt::Display, + sync::{Arc, Mutex, OnceLock}, +}; #[cfg(feature = "async")] use std::pin::Pin; @@ -66,6 +70,8 @@ where #[cfg(feature = "general_renderer")] pub general_renderer_name: GeneralRendererSetting, + + pub(crate) resources: GlobalResources, } impl Program @@ -101,6 +107,7 @@ where #[cfg(feature = "general_renderer")] general_renderer_name: GeneralRendererSetting::Disable, + resources: Arc::new(Mutex::new(HashMap::new())), } } -- cgit