1
\$\begingroup\$

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?

\$\endgroup\$
1
\$\begingroup\$
  • You could try SDL_SetWindowShape which 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
\$\endgroup\$
0
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.