Message-ID: <1374335350.m2f.38154 at forums.libsdl.org>
Content-Type: text/plain; charset="iso-8859-1"
Rainer Deyke wrote:
... If this works, t_offset should converge on a stable and correct
I like it (though I detect a few minor mistakes in your code, such as
putting this in SDL_PumpEvents instead of SDL_PushEvent). I think this
would work well.
- I like having separate os_timestamp and sdl_timestamp. This way, if the
application programmer wanted accurate event-event time differences, they
could use the os_timestamp, and if they wanted accurate event-GetTicks time
differences, they could use the sdl_timestamp. However, including both
timestamps in SDL2's event data structures would require changing their
layout. Is this still a possibility at this late date?
I think that would depend on whether the SDL_Event copy function winds
up in the linker-stub or the dynamic-library:
1) If it winds up in the dynamic library then we would need to add
another set of event functions, so that the ABI didn't get broken (the
alternative is that you screw around with the contents of the stack,
or wherever else you declared the event instance at);
2) If it winds up in the linker-stub then the program will always be
using the same copy function because it carries it around with itself,
thereby causing anything added at the end of the current event
structure to simply be ignored.
As for adding data members, as long as they go at the end of the
structure there shouldn't ever be a problem inside of the structure
itself. That having been said, it would be nice to have a structure
member that carries the actual size of the event, so that e.g.
libraries that care about the extra data can know if it's there or
not. Thus, if another set of event functions have to be added, perhaps
make them use a wrapper structure consisting of a size followed by the
actual SDL_Event instance?> Date: Sat, 20 Jul 2013 08:49:11 -0700
To: sdl at lists.libsdl.org
Subject: Re: SDL Why is event timestamp not propagated from