Add CameraMainTextureUsages helper method (#19549)

Split off from https://github.com/bevyengine/bevy/pull/19058
This commit is contained in:
JMS55 2025-06-08 21:54:14 -07:00 committed by GitHub
parent ec307bcb9f
commit 16440be327
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1060,6 +1060,7 @@ pub fn camera_system(
#[reflect(opaque)] #[reflect(opaque)]
#[reflect(Component, Default, Clone)] #[reflect(Component, Default, Clone)]
pub struct CameraMainTextureUsages(pub TextureUsages); pub struct CameraMainTextureUsages(pub TextureUsages);
impl Default for CameraMainTextureUsages { impl Default for CameraMainTextureUsages {
fn default() -> Self { fn default() -> Self {
Self( Self(
@ -1070,6 +1071,13 @@ impl Default for CameraMainTextureUsages {
} }
} }
impl CameraMainTextureUsages {
pub fn with(mut self, usages: TextureUsages) -> Self {
self.0 |= usages;
self
}
}
#[derive(Component, Debug)] #[derive(Component, Debug)]
pub struct ExtractedCamera { pub struct ExtractedCamera {
pub target: Option<NormalizedRenderTarget>, pub target: Option<NormalizedRenderTarget>,