-
Notifications
You must be signed in to change notification settings - Fork 476
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
Please add support for the new raw-window-handle
crate
#910
Comments
I'd like to keep this crate dependency-free; however, I'm not against including it behind a feature, much like some crates have a "serde" feature and the like. If someone would like to have a go at this, feel free to hit me up if you want some help! Although that should be a pretty straightforward integration overall. |
A friend and I did a little work to see what it would take to get The changes are mostly trivial, but given the cmake and native code dependency I'm curious if you would be interested in including the work? I can at least contribute the macos and X11 bindings! |
It looks a little bit complicated and unconventional (to use ObjectiveC inside build.rs code or the like...), but I guess we have no choice. I am in favor of implementing raw-window-handle, but behind a feature gate like "raw-window-handle" or similar. You can start with X11 and macos, we'll probably find people interested in other platforms as well as time goes by. |
|
@Lokathor what are you running that's using the |
I actually dont use it with anything since SDL2 can open a GL context all on its own. Basically the Or you could figure out some sort of view, but i left it as null because when i asked "what view?" they said it was too hard to pick a default and the graphics api should pick somehow :P |
I opened a PR to get it into |
So I'm stuck. I need to be able to run bindgen to get the platform-specific struct members for the window handle, but the project doesn't build because the pixel constants' namespace in |
rifle through here, where I keep various bindings for various targets and SDL2 versions pre-generated: https://github.com/Lokathor/fermium/tree/master/src |
I'm not sure what I would do with these. What were you thinking? |
look at the appropriate struct in whatever file and just use that. Or you could delve into |
I've got something working! Thanks for pointing me at your pregenerated files, that was super helpful. PR's in the works. |
Closing since this got merged. |
Recently the gamedev-wg has been trying to make it easier for windowing libs and graphical libs to agree on a protocol for communication. This has resulted in the raw-window-handle crate, where the window offers up its OS window handle thingy to the graphical lib upon request and then the graphical lib is able to do its startup.
In terms of SDL2, this would involve a call to https://wiki.libsdl.org/SDL_GetWindowWMInfo and then matching and converting the data over.
Tracking issue where this crate was discussed and crated if you have any questions: rust-gamedev/wg#26
The text was updated successfully, but these errors were encountered: