How do i use mutisampiling on glutin >= 0.30?
ar37-rs opened this issue · 8 comments
ar37-rs commented
How do i use mutisampiling on glutin >= 0.30?
kchibisov commented
ar37-rs commented
@kchibisov I tired cargo run --example window
and set with_sample_buffers(8)
it gives me error like so:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { raw_code: None, raw_os_message: None, kind: BadConfig }', glutin_examples/examples/window.rs:37:61
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
GL Version: OpenGL 4.1
kchibisov commented
It could mean that you don't have that many sample buffers. Try something lower, since it's a count of buffers. Usually 1
, 2
, and 4
. You got a note that you've passed a config that doesn't make much sense on that platform.
kchibisov commented
I think I've got your issue. I'll take a look. You want 8 samples for a buffer in a sample buffer and not sample buffers amount.
ar37-rs commented
@kchibisov, exactly. I meant anti-aliasing
ar37-rs commented
If there's a doc or quote for that (how to set anti-aliasing) on the exmaple, that would be nice.
ar37-rs commented
@kchibisov On glutin 0.29.1 there's a simple way how to do that:
#[inline]
pub fn with_multisampling(mut self, samples: u16) -> Self {
self.pf_reqs.multisampling = match samples {
0 => None,
_ => {
assert!(samples.is_power_of_two());
Some(samples)
}
};
self
}