The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Monotonic clocks and OS X
urkle


Joined: 23 Sep 2012
Posts: 77
I'm working on some patches to implement monotonic clocks on OS X (die gettimeofday die)


While working on that I noticed one odd thing, the test rig isn't calling SDL_Init only SDL_VideoInit. And by doing that it bypasses the call to SDL_StartTick() that is performed in SDL_InitSubsystem ?


Before I go nuts and refactor the initialization, I'd like input on a "clean and simple way" to ensure that SDL_StartTick is always run?



Edward Rudd
OutOfOrder.cc
Skype: outoforder_cc
317-674-3296
Monotonic clocks and OS X
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
If you're willing to take the hit of an if statement in GetTicks(), you can keep a static bool initializer around...


On Thu, May 2, 2013 at 2:50 PM, Edward Rudd wrote:
Quote:
I'm working on some patches to implement monotonic clocks on OS X (die gettimeofday die)


While working on that I noticed one odd thing, the test rig isn't calling SDL_Init  only SDL_VideoInit.  And by doing that it bypasses the call to SDL_StartTick() that is performed in SDL_InitSubsystem ?


Before I go nuts and refactor the initialization, I'd like input on a "clean and simple way" to ensure that SDL_StartTick is always run?



Edward Rudd
OutOfOrder.cc
Skype: outoforder_cc
[url=tel:317-674-3296]317-674-3296[/url]













_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Monotonic clocks and OS X
urkle


Joined: 23 Sep 2012
Posts: 77
I chatted with ryan some yesterday and committed in a quick workaround. Where by basically moved some stuff around slightly just hit the initiailzer from SDL_InitSubsystems (as it was before) and hit it also from SDL_VideoInit..

But good news is we have proper monotonic time on OS X & Linux now..

On May 4, 2013, at 6:09 , Sam Lantinga wrote:
Quote:
If you're willing to take the hit of an if statement in GetTicks(), you can keep a static bool initializer around...


On Thu, May 2, 2013 at 2:50 PM, Edward Rudd wrote:
Quote:
I'm working on some patches to implement monotonic clocks on OS X (die gettimeofday die)


While working on that I noticed one odd thing, the test rig isn't calling SDL_Init only SDL_VideoInit. And by doing that it bypasses the call to SDL_StartTick() that is performed in SDL_InitSubsystem ?


Before I go nuts and refactor the initialization, I'd like input on a "clean and simple way" to ensure that SDL_StartTick is always run?



Edward Rudd
OutOfOrder.cc
Skype: outoforder_cc
[url=tel:317-674-3296]317-674-3296[/url]













_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Edward Rudd
OutOfOrder.cc
Skype: outoforder_cc
317-674-3296
Monotonic clocks and OS X
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Great. :)


On Sat, May 4, 2013 at 8:44 AM, Edward Rudd wrote:
Quote:
I chatted with ryan some yesterday and committed in a quick workaround.  Where by basically moved some stuff around slightly just hit the initiailzer from SDL_InitSubsystems (as it was before) and hit it also from SDL_VideoInit.. 

But good news is we have proper monotonic time on OS X & Linux now..

On May 4, 2013, at 6:09 , Sam Lantinga wrote:

Quote:
If you're willing to take the hit of an if statement in GetTicks(), you can keep a static bool initializer around...


On Thu, May 2, 2013 at 2:50 PM, Edward Rudd wrote:
Quote:
I'm working on some patches to implement monotonic clocks on OS X (die gettimeofday die)


While working on that I noticed one odd thing, the test rig isn't calling SDL_Init  only SDL_VideoInit.  And by doing that it bypasses the call to SDL_StartTick() that is performed in SDL_InitSubsystem ?


Before I go nuts and refactor the initialization, I'd like input on a "clean and simple way" to ensure that SDL_StartTick is always run?



Edward Rudd
OutOfOrder.cc
Skype: outoforder_cc
[url=tel:317-674-3296]317-674-3296[/url]













_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Edward Rudd
OutOfOrder.cc
Skype: outoforder_cc
[url=tel:317-674-3296]317-674-3296[/url]
















_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org