-
Notifications
You must be signed in to change notification settings - Fork 19
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
Usage in OpenGL application #6
Comments
This problem is caused by airspace issue. actually whatever you are drawing on to the window is drawn under the blurred visual. this is an issue that Microsoft couldn't even fix until now. Direct Composition Visuals always stays on top in the window |
Would it be possible to submit the opengl buffer directly into the direct composition? so that we control the z-index of each buffer? |
i am not much familiar with opengl, but if it is possible for you to draw opengl content into ID2D1Bitmap1 then you can share it to IDCompositionVisual. eg: in AcrylicComositor.cpp i have used The IDComposition has many limitations and the new Windows.UI.Composition will be a better option. |
Interesting, I'm using Vulkan & GLFW, and after some fighting with how my setup works, I finally got it to work, but I too also noticed that the Direct Composition is always on top over the rendered frame... I'm sure there's a way to draw the Vulkan content into a ID2D1Bitmap1, so I'll be investigating into that. How would the ID2D1Bitmap1 data be used? Is there a function to pass it or something? |
It's been a little long since I have worked on this, We can only place a Example: This version of DirectComposition is not used now a days, everyone is moving to WinUI3 or WinRT API's |
Interesting, I'm using glfw so I'm not sure which version it natively uses for windows in regards to winapi, maybe it's using winrt, idk. But maybe there's a way to render a DirectComposition to an offscreen texture, not render it over everything, and use that as a texture for the background of my application. |
I think that is not possible. According to Microsoft docs: A visual tree must be bound to a window before any of the tree's visuals can be displayed on the screen. The window, called the composition target window, can be a top-level window or a child window. Also, the composition target window can be a layered window; that is, it can have the WS_EX_LAYERED window style. DirectComposition allows an application to bind a maximum of two visual trees to each window. The visual trees include one that is composed on top of the window itself, but behind all of the window’s child windows, and another that is composed on top of the window and on top of the child windows. In other words, each window has four conceptual layers, and all layers are clipped to the target window's visible region. |
This works brilliantly in a stand-alone window, however when I try to implement it in an OpenGL & GLFW window , any objects drawn by OpenGL do not appear . Any ideas what could be wrong?
(Windows 10 21H1 )
The text was updated successfully, but these errors were encountered: