use std::sync::{Arc, Mutex}; use bevy::{ecs::query::QueryItem, prelude::*, render::extract_component::ExtractComponent}; 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, }