Hello,
I'm trying to get a transparent backbuffer, for integrating my DX-rendered gui better with the rest of the OS. I've got a few questions/issues with that though:
- I've found out that I'm supposed to use DwmExtendFrameIntoClientArea for that. It also kind of works, though I get some sort of strange alpha/z-ordering issues, as you can see in Issue.png. Here is the code I'm using the create the window (plain old windows w/o any libary): (see edit below)
- Even though I can now see whats underneath the empty areas of my GUI... I still can't click/do anything else there, since the empty backbuffer is still overlapping the whole screen. Is there any way of "deactivating" certain areas of my backbuffer/invisible window, so that my application behaves like it was rendered using normal windows? Note that I can't just move the backbuffer as the main window you see moves, because there might be popup-windows of all sorts, which can go over the area of the main window... so any method for willingly deactivate area of a window?
EDIT: Ok, I was too fast in blaming the windows-part for this. Apparently the issue is with my rendering, because its those areas with the weird issues, where I render an alpha-blended texture over a solid texture. That happens for all my texts, and also for the icon in the upper left. Now I can get rid of this effect for most parts, by using alpha testing via clip (when alpha in the texture is 0), but what am I supposed to do when I have semi-transparent values, like the edges of the icon in the upper left? I can't just disable alpha-writing all together, since after clearing everything in the backbuffer is 0 (transparent). But I need to somehow only write alpha when the value is greater then what is currently in the buffer.
I'm rendering my gui with painters-algorithm and batched, so everything that is on top gets drawn last, in one go. Is there any way to achieve this kind of alpha-effect to fix my issue? So what I want summed up is:
- Every pixel with alpha > 0 should get drawn.
- In case texture pixel alpha is greater than backbuffer pixel alpha, the alpha value is written
- Otherwise, the pixel should still be blended to the content thats already in the backbuffer, but alpha value should stay the same.
EDIT2: Ugh, I'm just too tired to think. Of course I can configurate the AlphaSrcBlend and AlphaDestBlend-states to fig this issue. Havn't used those in a while, huh. So the rendering problems are solved now, though Issue#2 is still up. Any ideas for that?