I would like to draw an avatar over the desktop, something similar to those word 97 assistants, my idea so far is to make only the background transparent but I haven't had any luck, any suggestion? is it possible to make with SDL2?
- You could try
SDL_SetWindowShapewhich is implemented but is not officially documented, probably because it does not work well on all supported platforms. It may work for major platforms though (Windows, macOS, X11/Mir/DirectFB)
- Try this Windows-only approach: https://stackoverflow.com/q/4052940/2038264 The caveat is that graphics performance will be very slow since it involves coping GPU data to RAM every frame
Not with SDL directly. These sorts of things are generally accomplished by getting the DC of the desktop window and drawing to it using GDI. I'm not sure how well that technique works with the window composition manager of modern Windows.
You could also look at using
SetWindowRgn to define a non-rectangular window. This imposes some pretty strict limits on the overall outline of your little avatar though.