-
-
Notifications
You must be signed in to change notification settings - Fork 477
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
WGL backend supports_transparency is false #1717
Comments
it's called. https://github.com/rust-windowing/glutin/blob/master/glutin_examples/src/lib.rs#L86 nvm, it's actually not called for wgl, because of how wgl weirdly works, there's also no way you can finalize a window with WGL though, since you must create window before creating everything else, so only further configs will work for extra windows, but not the first one. |
glutin does't modify anything and only adjusts the transparency in winit integration to account for transparency of the config, since it does affect the way it all works on other platforms. If you draw opaque content it can do optimization resulting in overall better performance, when transparency is disabled. The point with alpha is that if there's no alpha how would you draw a transparent window, etc? It still may work sometimes on some systems, but generally not. |
I apologize for any misunderstanding. I was trying to say that Glutin sets transparency to false if the config supports_transparency() is false. The issue I'm facing is that I need a transparent window, but I can't achieve this because the finalize_window function is called in eframe, and within this function, transparency is set to false. My system is definitely capable of rendering transparent windows, but I'm not sure how to debug why GetPixelFormatAttribivARB(TRANSPARENT_ARB) returns false on my system (for all pixel formats). I would appreciate any workarounds or solutions for this problem. |
What I said before is that Please, inspect transparency support inside the example and whether it's really false for you for all the configs out there. |
https://pastebin.com/Vwwq78z4 |
@godlikedh well, glutin-winit just suggests on how to handle things, since it doesn't limit glutin in any way. If you think that transparency works in certain setups, then I guess you can assume so. I've also state again, that on windows in a correct handling, you won't end up in For reference on other platforms finilize is needed to avoid rendering issues when you draw transparent surface into opaque window. It could also always be just a bug in the driver, which are quite common... Maybe there're other means to detect transparency support or maybe it should be assumed to be always true these days, and we can somehow flip the handling, but I'll leave it up to someone who understands. I wonder what e.g. SDL2 does and whether it checks for transparency that way. In anyway, you're free to tune code however you want, glutin just lists whatever is present. I've also expected egui to use things directly and not depend on |
@kchibisov maybe wgl_backend supports_transparency function should be changed to something else? or maybe just return true? or maybe check GPU if it is and AMD? |
If they don't support, then they should return an error instead instead of not working? It just doesn't make any sense tbh. I'm also not sure how to check driver used with just wgl alone. |
Note that
|
Hello!
I attempted to create a transparent window using egui, but it was not transparent. After investigating further, I discovered that the issue stems from the finalize_window (https://github.com/rust-windowing/glutin/blob/master/glutin-winit/src/lib.rs#L194) function. The supports_transparency method returns false for me. Upon additional research, it appears that the wgl_extra::TRANSPARENT_ARB attribute is consistently false on my setup, which seems odd given that I have a modern discrete GPU with up-to-date drivers. And this attribute is false on windows, compiling and running same code under WSL ubuntu makes this attribute True.
Moreover, the Glutin window example is transparent since the finalize_window function is never called for it. I'm wondering if it's safe to remove this check entirely and proceed without it. According to the Winit code, it creates transparent windows without performing any compatibility checks. So, I'm confused about why Glutin modifies this behavior.
Could someone clarify this for me or suggest a solution?
The text was updated successfully, but these errors were encountered: