Transparent window, not OpenGL content

Hi,

I’ve come across another problem in my SDL project. My approach is to set window as borderless and fully transparent and draw my own window in OpenGL. Unfortunately, using SDL_SetWindowOpacity I set opacity for window and everything that’s inside it. I tried retrieving hwnd info and set transparency by “SetLayeredWindowAttributes” but it does the same. Everything I want to achieve are rounded window edges. Tried to google my problem and find anything related to my problem in SDL 2.0 documentation but didn’t manage to solve it.

Thanks.

That was quite fast… I thought I have tried everything.

SetLayeredWindowAttributes(hwnd, RGB(255,255,255), 0, LWA_COLORKEY)

This setting will set all white content in window to transparent.

Problem solved :man_facepalming:

Hi,
I’m currently trying to do the same, but I’m having trouble getting SetLayeredWindowAttributes to work. Do you have the source code on hand that you used? I want to double check that my setup code is correct. If so, could you post it here for reference?