Skip to content

Conversation

@htmlboss
Copy link
Owner

@htmlboss htmlboss commented Oct 2, 2021

Re-write Timer class to fire a user-defined callback function at a regular user-defined interval (i.e. make Timer generic and thus more reusable).

  • Also extracted the notion of frame time from the class since that's really more of an Engine concern.
@htmlboss htmlboss self-assigned this Oct 2, 2021
public:
Timer() noexcept;

Timer(const double secondsBetweenCallbackTriggers, TimerCallbackFunc callback)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TimerCallbackFunc is passed by value for performance reasons since we're storing it https://stackoverflow.com/a/18366273/2231969

@htmlboss htmlboss merged commit 385f966 into master Oct 3, 2021
@htmlboss htmlboss deleted the improve-timer-class branch October 3, 2021 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant