We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1b68845 + dd71b55 commit ce8a7edCopy full SHA for ce8a7ed
src/sdl2/raw_window_handle.rs
@@ -8,6 +8,15 @@ unsafe impl HasRawWindowHandle for Window {
8
fn raw_window_handle(&self) -> RawWindowHandle {
9
use self::SDL_SYSWM_TYPE::*;
10
11
+ // Check if running on web before continuing,
12
+ // since SDL_GetWindowWMInfo will fail on emscripten
13
+ if cfg!(target_os = "emscripten") {
14
+ use self::raw_window_handle::WebHandle;
15
+ let mut handle = WebHandle::empty();
16
+ handle.id = 1;
17
+ return RawWindowHandle::Web(handle);
18
+ }
19
+
20
let mut wm_info: SDL_SysWMinfo = unsafe { std::mem::zeroed() };
21
22
// Make certain to retrieve version before querying `SDL_GetWindowWMInfo`
0 commit comments