Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
not-fl3 committed May 26, 2024
1 parent b1e9200 commit cf5e4f9
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 24 deletions.
2 changes: 1 addition & 1 deletion examples/blobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl Stage {
VertexAttribute::new("in_uv", VertexFormat::Float2),
],
shader,
PipelineParams::default()
PipelineParams::default(),
);

let uniforms = shader::Uniforms {
Expand Down
2 changes: 1 addition & 1 deletion examples/post_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl Stage {
VertexAttribute::new("uv", VertexFormat::Float2),
],
default_shader,
PipelineParams::default()
PipelineParams::default(),
);

let offscreen_shader = ctx
Expand Down
2 changes: 1 addition & 1 deletion src/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub(crate) enum Request {
ShowMouse(bool),
SetMouseCursor(crate::CursorIcon),
SetWindowSize { new_width: u32, new_height: u32 },
SetWindowPosition{ new_x: u32, new_y: u32 },
SetWindowPosition { new_x: u32, new_y: u32 },
SetFullscreen(bool),
ShowKeyboard(bool),
}
Expand Down
33 changes: 17 additions & 16 deletions src/native/linux_wayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ unsafe extern "C" fn registry_add_object(
1,
) as _;
}
"zxdg_decoration_manager" |
"zxdg_decoration_manager_v1" => {
"zxdg_decoration_manager" | "zxdg_decoration_manager_v1" => {
display.decoration_manager = display.client.wl_registry_bind(
registry,
name,
Expand Down Expand Up @@ -773,20 +772,22 @@ where

while let Ok(request) = rx.try_recv() {
match request {
Request::SetFullscreen(full) => if full {
wl_request!(
display.client,
display.xdg_toplevel,
extensions::xdg_shell::xdg_toplevel::set_fullscreen,
std::ptr::null_mut::<*mut wl_output>()
);
} else {
wl_request!(
display.client,
display.xdg_toplevel,
extensions::xdg_shell::xdg_toplevel::unset_fullscreen
);
},
Request::SetFullscreen(full) => {
if full {
wl_request!(
display.client,
display.xdg_toplevel,
extensions::xdg_shell::xdg_toplevel::set_fullscreen,
std::ptr::null_mut::<*mut wl_output>()
);
} else {
wl_request!(
display.client,
display.xdg_toplevel,
extensions::xdg_shell::xdg_toplevel::unset_fullscreen
);
}
}

// TODO: implement the other events
_ => (),
Expand Down
19 changes: 15 additions & 4 deletions src/native/linux_x11/glx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,12 @@ pub struct Glx {
}

impl Glx {
pub unsafe fn init(libx11: &mut LibX11, display: *mut Display, screen: i32, conf: &crate::conf::Conf) -> 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 +256,14 @@ 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, conf.sample_count);
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,9 +401,8 @@ unsafe fn choose_fbconfig(
display: *mut Display,
screen: i32,
multisample: bool,
desired_sample_count: i32
desired_sample_count: i32,
) -> GLXFBConfig {

let native_configs: *mut GLXFBConfig;
let closest: *const GLFBConfig;
let mut native_count: libc::c_int = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/native/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl MacosDisplay {
new_height,
} => self.set_window_size(new_width as _, new_height as _),
SetFullscreen(fullscreen) => self.set_fullscreen(fullscreen),
SetWindowPosition{new_x, new_y} => {
SetWindowPosition { new_x, new_y } => {
eprintln!("Not implemented for macos");
}
_ => {}
Expand Down

0 comments on commit cf5e4f9

Please sign in to comment.