unsafe in user code #2636
kirillsurkov
started this conversation in
General
Replies: 1 comment
-
wgpu is still quite low-level, so not everything is safe. In this case it's because wgpu doesn't handle the actual window creation, and so it's relying on you to do that correctly and pass a valid window handle. Passing an invalid window handle could result in UB. If you want a higher-level library which handles things like window setup automatically, you might try bevy. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I recently started learning Rust. As the start point I chose some simple 3D application, and after a while I found this library.
I'm a little bit confused about using
unsafe
in user code. E.g. this example: https://github.com/gfx-rs/wgpu/blob/master/wgpu/examples/hello-triangle/main.rs#L11Isn't it possible to avoid those unsafes in user code? Is it language limitation or library imperfection?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions