Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplemented blocking_event_loop for OSX #460

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/graphics/metal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,6 @@ pub struct Buffer {
next_value: usize,
}

#[derive(Clone, Copy, Debug, PartialEq)]
struct ShaderUniform {
size: u64,
offset: u64,
format: MTLVertexFormat,
}

#[derive(Debug)]
struct ShaderInternal {
vertex_function: ObjcId,
Expand Down
4 changes: 2 additions & 2 deletions src/native/apple/frameworks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ pub use {
class,
declare::ClassDecl,
msg_send,
runtime::{Class, Object, Protocol, Sel, BOOL, NO, YES},
runtime::{Class, Object, Sel, BOOL, NO, YES},
sel, sel_impl, Encode, Encoding,
},
std::{ffi::c_void, os::raw::c_ulong, ptr::NonNull},
std::{ffi::c_void, ptr::NonNull},
};

//use bitflags::bitflags;
Expand Down
8 changes: 5 additions & 3 deletions src/native/ios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,10 @@ pub fn define_glk_or_mtk_view_dlg(superclass: &Class) -> *const Class {
d.screen_width = screen_width;
d.screen_height = screen_height;
}
send_message(Message::Resize { width: screen_width, height: screen_height });
send_message(Message::Resize {
width: screen_width,
height: screen_height,
});
}

if let Some(ref mut event_handler) = payload.event_handler {
Expand Down Expand Up @@ -648,8 +651,7 @@ pub fn define_app_delegate() -> *const Class {
// I hope it will work the same on the real device.
if conf.platform.blocking_event_loop {
msg_send_![&*view, performSelectorOnMainThread:sel!(setNeedsDisplay) withObject:nil waitUntilDone:NO];
}
else {
} else {
msg_send_![&*view, performSelectorOnMainThread:sel!(display) withObject:nil waitUntilDone:YES];
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/native/linux_x11/keycodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ pub unsafe fn translate_mouse_button(button: i32) -> MouseButton {
};
}

pub unsafe extern "C" fn keysym_to_unicode(libxkbcommon: &mut LibXkbCommon, keysym: super::libx11::KeySym) -> i32 {
return (libxkbcommon.xkb_keysym_to_utf32)(keysym as u32) as i32
pub unsafe extern "C" fn keysym_to_unicode(
libxkbcommon: &mut LibXkbCommon,
keysym: super::libx11::KeySym,
) -> i32 {
return (libxkbcommon.xkb_keysym_to_utf32)(keysym as u32) as i32;
}
Loading
Loading