Embedding SDL Window in a QWidget

Hi,

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());
putenv(envr);
/***************/

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 ).

Cheers.
Adrien.

DI MASCIO ADRIEN wrote:

Hi,

I’m trying to embed a SDL Window in a QWidget. I’ve already seen some
mails in the list which should

I’ve found a solution.

Thanks anyway.

Cheers,

Adrien.

DI MASCIO ADRIEN wrote:

Hi,

I’m trying to embed a SDL Window in a QWidget. I’ve already seen some
mails in the list which should

I’ve found a solution.

So, what was the solution?

Thanks,
-Sam Lantinga, Software Engineer, Blizzard Entertainment