Greetings,
I have a passing curiosity … I notice in nearly all structs of the SDL_Event union that there is a window_id field, except for the SDL_JoystickButton & company structs.
Is this an oversight or intended design?
Cheers!
Jeffrey Carpenter
Hi,
I have a passing curiosity … I notice in nearly all structs of the
SDL_Event union that there is a window_id field, except for the
SDL_JoystickButton & company structs.
Is this an oversight or intended design?
I think it is intended, because for joysticks it makes no sense to
associate their events with a specific window. This is as opposed to for
example keyboard, mouse and touch events, which are usually processed
by the computer’s user interface and are usually associated with the
currently focussed window.
This is comparable to sound cards, which are also used on a global
level (the sound might even play if your application is in the
background, and if your application has more than one window, the sound
usually does not depends on whch window is focussed) and which are not
window-specific.
Best,
Felix>
Cheers!
Jeffrey Carpenter
–
Felix Fontein – @Felix_Fontein – https://felix.fontein.de/
In a bit of irony in light of your recent statements, on the old Windows Multimedia API (winmm.dll) the sound contexts ARE associated with a window handle.
However DirectInput and XINPUT and even DirectSound are not tied to a window handle, so your statement about all the more recent APIs is quite true.On 03/10/2014 02:25 PM, Felix Fontein wrote:
Hi,
I have a passing curiosity … I notice in nearly all structs of the
SDL_Event union that there is a window_id field, except for the
SDL_JoystickButton & company structs.
Is this an oversight or intended design?
I think it is intended, because for joysticks it makes no sense to
associate their events with a specific window. This is as opposed to for
example keyboard, mouse and touch events, which are usually processed
by the computer’s user interface and are usually associated with the
currently focussed window.
This is comparable to sound cards, which are also used on a global
level (the sound might even play if your application is in the
background, and if your application has more than one window, the sound
usually does not depends on whch window is focussed) and which are not
window-specific.
Best,
Felix
Cheers!
Jeffrey Carpenter
–
LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier
I see! It makes sense to me now, seeing it from that context. Thanks 
Cheers!
Jeffrey CarpenterOn 2014/03/ 10, at 16:25, Felix Fontein wrote:
Hi,
I have a passing curiosity … I notice in nearly all structs of the
SDL_Event union that there is a window_id field, except for the
SDL_JoystickButton & company structs.
Is this an oversight or intended design?
I think it is intended, because for joysticks it makes no sense to
associate their events with a specific window. This is as opposed to for
example keyboard, mouse and touch events, which are usually processed
by the computer’s user interface and are usually associated with the
currently focussed window.
This is comparable to sound cards, which are also used on a global
level (the sound might even play if your application is in the
background, and if your application has more than one window, the sound
usually does not depends on whch window is focussed) and which are not
window-specific.
Best,
Felix
Cheers!
Jeffrey Carpenter
–
Felix Fontein – felix at fontein.de – https://felix.fontein.de/
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org