[SDL] Embedding SDL Window in a QWidget

DI MASCIO ADRIEN adimasci at etudiant.univ-mlv.fr
Mon Jul 8 06:05:01 PDT 2002


I'm trying to embed a SDL Window in a QWidget. I've already seen some 
mails in the list which should have soluced my problem, but it's not the 
case. My first intention was to create a little window inside which I 
could play some video (The librairy I use for playing video use SDL). 
For now, the video is playing in a separate window, and I would like to 
embed this SDL window in a little widget (just to make a basic player 
with 4 buttons (play, stop, ...)).
The solution seems to set the SDL envvar SDL_WINDOWID to my QWidget's 
ID. This doesn't work. The video is still played in a separate window.
I've done it this way :
char envr[50];
sprintf(envr,"SDL_WINDOWID=%ld", (long)winId());

I've also tried to do a tiny sample with a SDL Window which displays a 
BMP, and I've tried to embed this window in a QWidget. It worked, but 
the image doesn't refresh properly (actually, doesn't refresh at all).

Could anyone send me a small sample of code working ? (Just a little 
widget with one button, and a SDL Window in it ).


More information about the SDL mailing list