Black screen when setting window to transparent and size to 1920x1080


I looked through some posts and found that this could be a GPU issue, but as long as the window isn’t my entire monitor’s resolution it works as intended - the window is transparent.

I am on an NVIDIA GPU and have tried running in compatability mode for windows 8 + disabled fullscreen optimizations - nothing works! Maybe its a setting?

Hi @awdoiunauiwdn,

Welcome to the GLFW forum.

Are you using the GLFW_TRANSPARENT_FRAMEBUFFER window hint or the glfwSetWindowOpacity function for this?
See GLFW: Window guide

Additionally, when you say the window isn’t my entire monitor’s resolution do you mean going fullscreen?

I am not sure what might cause this issue but it could indeed be a driver problem, though I if it is a fullscreen window then I’m not sure transparency is supported when fullscreen.

Hello, thank you so much for your response!

I am using the GLFW_TRANSPARENT_FRAMEBUFFER flag. I am not sure why this is happening, but I asked my friend to download the program and it is happening to him as well.

I don’t mean fullscreen as in GLFW_FULLSCREEN, but I mean seting the window resolution to the monitors resolution.

Thanks again!

I tried a quick experiment and on my Windows 11 system with AMD GPU I found that transparency won’t work if the undecorated window is set to the same size and position as the monitor.

I suspect this is due to the driver switching to a fullscreen mode. Since OpenGL doesn’t have an actual method for setting a fullscreen framebuffer this is done at the driver level, and GLFW has no control over this.

There is a solution to this problem which I forgot when I last posted.

Basically instead of making a window of the exact size of the monitor you make it slightly larger, but then only draw to the part which overlaps your monitor. This ‘fools’ the driver into not engaging the fullscreen path and you can get a transparent overlay over the monitor. I tried this and it appears to work.

I multimonitor situations you might need to try not to overlap other monitors, though in some very rare cases this won’t be possible.