Skip to content

Commit

Permalink
fix x11 glx multisample support
Browse files Browse the repository at this point in the history
  • Loading branch information
Lishen authored and not-fl3 committed Nov 14, 2023
1 parent f9899b5 commit 5327890
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/native/linux_x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ unsafe fn glx_main_loop<F>(
where
F: 'static + FnOnce() -> Box<dyn EventHandler>,
{
let mut glx = match glx::Glx::init(&mut display.libx11, display.display, screen) {
let mut glx = match glx::Glx::init(&mut display.libx11, display.display, screen, conf) {
Some(glx) => glx,
_ => return Err(display),
};
Expand Down
6 changes: 3 additions & 3 deletions src/native/linux_x11/glx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pub struct Glx {
}

impl Glx {
pub unsafe fn init(libx11: &mut LibX11, display: *mut Display, screen: i32) -> Option<Glx> {
pub unsafe fn init(libx11: &mut LibX11, display: *mut Display, screen: i32, conf: &crate::conf::Conf) -> Option<Glx> {
let mut libgl = LibGlx::try_load()?;

let mut errorbase = 0;
Expand Down Expand Up @@ -251,7 +251,7 @@ impl Glx {
// _sapp_glx_ARB_create_context_profile =
// _sapp_glx_extsupported(b"GLX_ARB_create_context_profile\x00", exts);

let fbconfig = choose_fbconfig(&mut libgl, libx11, display, screen, multisample);
let fbconfig = choose_fbconfig(&mut libgl, libx11, display, screen, multisample, conf.sample_count);
assert!(
!fbconfig.is_null(),
"GLX: Failed to find a suitable GLXFBConfig"
Expand Down Expand Up @@ -389,8 +389,8 @@ unsafe fn choose_fbconfig(
display: *mut Display,
screen: i32,
multisample: bool,
desired_sample_count: i32
) -> GLXFBConfig {
let desired_sample_count = 0;

let native_configs: *mut GLXFBConfig;
let closest: *const GLFBConfig;
Expand Down

0 comments on commit 5327890

Please sign in to comment.