Use separate types for each platform
chrisduerr opened this issue · 3 comments
I find the current API a bit strange, since it basically offers an enum that just has a single member on most platforms.
Is there any reason why the RawWindowHandle
isn't just a platform-specific type
that is decided at compile-time? It's not like people are going to be matching against the platform's implementation at runtime, especially since this is impossible because the enum has only the members available for the current platform.
The variants don't all match 1:1 with a platform, so the variant isn't known at compile-time. For example, Xlib, Xcb, and Wayland are all available on linux
Yeah, which is not a problem. You can still provide an enum for platforms that actually make a decision at runtime.
But adding a runtime check for something that can be uniquely identified at compile time just leads to unergonomic code.