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
Would it make sense to have some kind of "view" or "renderable" handle? #123
Comments
And on android, where |
Basically, I want better cooperation with the existing layout systems (if they exist). I'm especially unsure what the best approach is for building a "native" user interface on Linux? GTK? Or would it be best to do it "raw", and provide something like |
Wayland's wl_surface can be used for anything as well, but that's how the handle is done. I wonder whether on macOS you don't need to have a reference to a window to perform some requests on it? Also, the user could simply omit the window, fields are not required to be set, so setting just NSView is absolutely fine.
visual has nothing to do with windows on X11, it's a pixel format. Everything is a XID, which is window as it's said in the structs. |
The window field is entirely redundant on macOS, it can always be gotten from the view. So maybe it would actually make sense to rename the |
The common name for this thing on e.g. Android and in graphics APIs like (E)GL and Vulkan is a "surface", I'd name it that. OTOH it's not that in Vulkan/GL yet, you still have to create a Surface from a Surface which may sound weird? |
I'm only really familiar with macOS and iOS, but on those platforms it would make sense to split the window and the view handles in two.
That way, users could make some sort of interface in the native toolkit, and just provide the
NSView
handle towgpu
to render into. With the current design, we're assuming that the whole window's content is what should be rendered into.I think this is roughly how it already works on web, e.g. you can lay out the page in a certain way, and then just create a canvas that you pass on to the renderer to do its thing. (Though arguably
winit
shouldn't be creating a canvas, perhaps instead it should provide adiv
that the graphics library itself can insert the canvas into?)Would this sort of thing work on other platforms?
The text was updated successfully, but these errors were encountered: