Use of existing X Window

Hey there… ]) powered by Linux 2.4.8 ([

Ok, be warned, this is a newbie question. :slight_smile:

Is it possible to use SDL (YUV overlay, …) on an existing X11 window? This
may sound dumb but I am trying to write a video plugin for some software and
I have to use the window for video out it has opened at startup. :frowning:

Is there any trick how I can achieve that? Thanks in advance for any help. :-)–
So long, Matt ]) @Matthias_Dahl, GPG key available at public keyservers ([

Hey there… ]) powered by Linux 2.4.8 ([

Ok, be warned, this is a newbie question. :slight_smile:

Is it possible to use SDL (YUV overlay, …) on an existing X11 window? This
may sound dumb but I am trying to write a video plugin for some software and
I have to use the window for video out it has opened at startup. :frowning:

Is there any trick how I can achieve that? Thanks in advance for any help. :slight_smile:

You can use the SDL_WINDOWID hack to do this. Set the environment variable
SDL_WINDOWID to the window id of the window you want to display to. You won’t
get any SDL events for the window, and SDL should display to it.

I haven’t tried this with the YUV overlay though, so good luck. :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

The concept of embedding SDL into another window is generally pretty evil
in amd pf itself. Still, enough people are trying to do this for whatever
reason that I can understand the feature. But most toolkits AFAIK offer
generic buffers for whatever you want to put there. It would be less evil
to get one and turn it into a SDL_surface and draw to it, wouldn’t it?

I don’t have the source in front of me but I’m pretty sure this would
work, wouldn’t it? If not, it shouldn’t be too hard to do while you’re
redesigning stuff for 1.3…On Sun, Sep 23, 2001 at 10:43:24AM -0700, Sam Lantinga wrote:

Is there any trick how I can achieve that? Thanks in advance for any help. :slight_smile:

You can use the SDL_WINDOWID hack to do this. Set the environment variable
SDL_WINDOWID to the window id of the window you want to display to. You won’t
get any SDL events for the window, and SDL should display to it.


Joseph Carter Free software developer

  • Culus thinks we should go to trade shows and see how many people we
    can kill by throwing debian cds at them

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20010923/3db30d26/attachment-0007.pgp