diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -94,6 +94,7 @@ pub struct WindowBuilder<'a> { gl_debug: bool, vsync: bool, visible: bool, + multisampling: Option<u16>, } #[cfg(feature = "window")] @@ -109,6 +110,7 @@ impl<'a> WindowBuilder<'a> { gl_debug: cfg!(ndebug), vsync: false, visible: true, + multisampling: None, } } @@ -173,6 +175,18 @@ impl<'a> WindowBuilder<'a> { self } + /// Sets the multisampling level to request. + /// + /// # Panic + /// + /// Will panic if `samples` is not a power of two. + pub fn with_multisampling(mut self, samples: u16) -> WindowBuilder<'a> { + use std::num::UnsignedInt; + assert!(samples.is_power_of_two()); + self.multisampling = Some(samples); + self + } + /// Builds the window. /// /// Error should be very rare and only occur in case of permission denied, incompatible system, |