SDL2 + Raspberry Pi: Clearing the framebuffer

I am writing an SDL2 app using the framebuffer which calls another app which also uses the framebuffer. I am currently simply calling the other app (omxplayer) via the system() command as a proof-of-concept.

My problem is that my window seems to stay on top of the called app. I have tried SDL_HideWindow() as well as a whole host of other options (such as making the window size 0x0). The only thing I have been able to make work is to start to called app with popen() or inside a thread and then destroy my SDL instance. This is not preferable as I will be taking control back and do not want to have to re-create my window and renderer. Does anyone know of a solution?

Perhaps this?
https://wiki.libsdl.org/SDL_RaiseWindow

Jonny D

2014-03-16 4:30 GMT-03:00 Kibster :

I am writing an SDL2 app using the framebuffer which calls another app
which also uses the framebuffer. I am currently simply calling the other
app (omxplayer) via the system() command as a proof-of-concept.

My problem is that my window seems to stay on top of the called app. I
have tried SDL_HideWindow() as well as a whole host of other options (such
as making the window size 0x0). The only thing I have been able to make
work is to start to called app with popen() or inside a thread and then
destroy my SDL instance. This is not preferable as I will be taking control
back and do not want to have to re-create my window and renderer. Does
anyone know of a solution?

None of the window show/hide/resize related functions are implemented on
the RPi backend:
http://hg.libsdl.org/SDL/file/b558f99d48f0/src/video/raspberry/SDL_rpivideo.c#l322

It’s basically designed to run as a single full screen window. That said,
the board has a layering system built in, if you display your stuff on a
layer with a higher level than what SDL uses (10000 for the window, 10001
for the mouse pointer), you’ll occlude the SDL window.–
Gabriel.