use std::sync::{Mutex, Arc}; use bevy::{prelude::*, render::extract_component::ExtractComponent, ecs::query::QueryItem}; use crate::render_assets::FramebufferExtractSource; #[derive(Component, Default, Clone)] pub struct FramebufferExtractDestination(pub Arc>); impl ExtractComponent for FramebufferExtractDestination { type QueryData = ( &'static Self, &'static Handle, ); type QueryFilter = (); type Out = (Self, Handle); fn extract_component((destination, source_handle): QueryItem<'_, Self::QueryData>) -> Option { Some(( destination.clone(), source_handle.clone(), )) } } #[derive(Bundle)] pub struct ExtractFramebufferBundle { pub source: Handle, pub dest: FramebufferExtractDestination, }