-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Create WGPU widget similar to Gtk.GLArea #1278
Comments
That's certainly possible but it would probably make sense for this to either a) be just an example in this repo, or b) an external crate that provides such a widget in a general way. Do you intend to work on this? |
It would be possible to use the gles backend quite easily for this (wgpu-hal has a way to create an Adapter from a glGetProcAddress like function). But there are limitations with the gles backend and the Vulkan backend would be preferred. However the Vulkan backend would either force gtk to initialize with Vulkan or share memory objects between apis. For a minimum viable product using the gles backend would be fine, but long term some work will be needed in wgpu (or an auxillary crate) to import memory objects from other apis. |
If someone wants to work on this, we could potentially have a crate that has useful "integration" widgets with the rest of the rust ecosystem. See also #1163 |
I'm interested in this for Linux and Windows. |
I was thinking that using the gtk webkit would get us some of the way there (even if not necessarily ideal). Epiphany (gnome's web browser) is using gtk4 as the ui toolkit and some of the demos of wgpu.rs work (only webgl2 though, not WebGPU). So using WebKitGTK inside a gtk4 app would allow for webgl2-based wgpu applications to run. And maybe WebGPU later if support is added in the future. |
I think there's a working implementation (at least on the architecture side) here : https://github.com/BartBM/wgpu-dma-buf What it does is As gtk 4.14 and gtk-rs 0.9 exposes the dma-buf graphics offloading on linux, it should be possible to make the same thing work on linux with Though that's linux-only for the moment (although it may come to windows in the future : https://gitlab.gnome.org/GNOME/gtk/-/issues/6869) Maybe it's possible to adapt the other part and do Now there are probably some things to adapt between OS to have this work on all platforms (with or without graphics offload) but it seems doable given that the same trick works with slint and glutin and it doesn't seem like there's too much conceptual difference between these and gtk. |
I've been wanting to create a GUI app using WGPU and use GTK for window decorations on Linux/BSD. Using OpenGL this can be done using GLArea covering the entire window with the widget. I have seen requests for this but not seen any implementation.
The text was updated successfully, but these errors were encountered: