use bevy_ecs::component::Component;
use windows::Win32::Graphics::Direct2D::ID2D1CommandList;
#[derive(Component, Debug, Clone, PartialEq)]
pub struct GraphicsCommandList {
command_list: Option<ID2D1CommandList>,
}
impl GraphicsCommandList {
pub fn new(command_list: ID2D1CommandList) -> Self {
Self {
command_list: Some(command_list),
}
}
pub fn empty() -> Self {
Self { command_list: None }
}
pub fn command_list(&self) -> Option<&ID2D1CommandList> {
self.command_list.as_ref()
}
}
unsafe impl Send for GraphicsCommandList {}
unsafe impl Sync for GraphicsCommandList {}