Skip to content

Commit

Permalink
add convenience function (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
Restioson authored Jan 3, 2021
1 parent ca310b8 commit 820f37f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/bevy_render/src/texture/sampler_descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ pub struct SamplerDescriptor {
pub anisotropy_clamp: Option<NonZeroU8>,
}

impl SamplerDescriptor {
/// Sets the address mode for all dimensions of the sampler descriptor.
pub fn set_address_mode(&mut self, address_mode: AddressMode) {
self.address_mode_u = address_mode;
self.address_mode_v = address_mode;
self.address_mode_w = address_mode;
}
}

impl Default for SamplerDescriptor {
fn default() -> Self {
SamplerDescriptor {
Expand Down

0 comments on commit 820f37f

Please sign in to comment.