Implement multisampling for x11

This commit is contained in:
Pierre Krieger 2014-11-24 19:35:31 +01:00
parent 596132dc93
commit 729551f828
4 changed files with 28 additions and 6 deletions

View file

@ -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,