Skip to content

Commit

Permalink
fix compiling egl gles on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
EriKWDev committed Dec 6, 2024
1 parent c7a5f68 commit 202a229
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
/blade-asset/cooked
/_failure.wgsl

libEGL.dylib
libGLESv2.dylib

.DS_Store
/.vs
/.vscode
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ del-geo = "=0.1.29"
egui-winit = "0.29"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
# see https://github.com/emilk/egui/issues/4270
egui-winit = { version="0.29", default-features=false, features=["links"] }
console_error_panic_hook = "0.1.7"
console_log = "1"
web-sys = { workspace = true, features = ["Window"] }
Expand Down
3 changes: 2 additions & 1 deletion blade-graphics/src/gles/egl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@ impl super::Context {
let window_ptr = unsafe {
use objc::{msg_send, runtime::Object, sel, sel_impl};
// ns_view always have a layer and don't need to verify that it exists.
let layer: *mut Object = msg_send![handle.ns_view.as_ptr(), layer];
let layer: *mut Object =
msg_send![handle.ns_view.as_ptr() as *mut Object, layer];
layer as *mut ffi::c_void
};
window_ptr
Expand Down
4 changes: 3 additions & 1 deletion examples/particle/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,9 @@ fn main() {
let control_flow = if let Some(repaint_after_instant) =
std::time::Instant::now().checked_add(repaint_delay)
{
winit::event_loop::ControlFlow::WaitUntil(repaint_after_instant)
winit::event_loop::ControlFlow::WaitUntil(
repaint_after_instant.into(),
)
} else {
winit::event_loop::ControlFlow::Wait
};
Expand Down

0 comments on commit 202a229

Please sign in to comment.