SDL Digest, Vol 34, Issue 46

Message: 1
Message-ID:
<3adffa60910142153k50f300dakd392d49eb026b80d at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Yes, you can use SDL_GetWMInfo().

Hi Mason, Thanks for your prompt reply… so if I am using Linux, will
there be a way to find out the XServer assigned window ID from the
window ID SDL uses internally?

Hi Sam, Thanks for your response. I tried this code segment within
test/testnativex11.c :

Window window = 0;
SDL_SysWMinfo info;

dpy = XOpenDisplay(NULL);
if (dpy) {
window =
XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, w, h, 0, 0,
0);
XMapRaised(dpy, window);
XSync(dpy, False);

   SDL_GetWMInfo(&info);

I get:

(gdb) print info
$2 = {version = {major = 72 ‘H’, minor = 29 ‘\035’, patch = 64 ‘@’},
subsystem = SDL_SYSWM_X11, info = {x11 = { display = 0x7fc4246b8592,
window = 0, lock_func = 0x21f0850, unlock_func = 0x7fc42447d4fa,
fswindow = 4201680, wmwindow = 1}}}

xwininfo gives 0x2400001

Any idea?

Thanks

Ratin> Date: Wed, 14 Oct 2009 21:53:57 -0700

From: Sam Lantinga
To: SDL Development List
Subject: Re: [SDL] SDL Digest, Vol 34, Issue 44

Did you check the return value? You need to set the version in the
info structure before you pass it in.On Fri, Oct 16, 2009 at 7:57 AM, Ratin wrote:

Message: 1
Date: Wed, 14 Oct 2009 21:53:57 -0700
From: Sam Lantinga <@slouken>
To: SDL Development List
Subject: Re: [SDL] SDL Digest, Vol 34, Issue 44
Message-ID:
? ? ? ?<3adffa60910142153k50f300dakd392d49eb026b80d at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Yes, you can use SDL_GetWMInfo().

Hi Mason, Thanks for your prompt reply… so if I am using Linux, will
there be a way to find out the XServer assigned window ID from the
window ID SDL uses internally?

Hi Sam, Thanks for your response. I tried this code segment within
test/testnativex11.c :

Window window = 0;
SDL_SysWMinfo ? info;

dpy = XOpenDisplay(NULL);
if (dpy) {
? ?window =
? ? ?XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, w, h, 0, 0,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0);
? ? ?XMapRaised(dpy, window);
? ? ?XSync(dpy, False);

? ? ? SDL_GetWMInfo(&info);

I get:

(gdb) print info
$2 = {version = {major = 72 ‘H’, minor = 29 ‘\035’, patch = 64 ‘@’},
subsystem = SDL_SYSWM_X11, info = {x11 = { display = 0x7fc4246b8592,
window = 0, lock_func = 0x21f0850, unlock_func = 0x7fc42447d4fa,
fswindow = 4201680, wmwindow = 1}}}

xwininfo gives 0x2400001

Any idea?

Thanks

Ratin


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC