#include <VSTGLTimer.h>
Inheritance diagram for Timer:
Public Member Functions | |
Timer (int interval) | |
Constructor. | |
virtual | ~Timer () |
Destructor. | |
bool | start () |
Call this to start the timer running. | |
void | stop () |
Call this to stop the timer running. | |
bool | isRunning () const |
Returns whether or not the timer is currently running. | |
virtual void | timerCallback ()=0 |
Called at every interval. | |
Static Public Member Functions | |
static void __stdcall | timerProc (HWND hWnd, unsigned int uMsg, unsigned int idEvent, unsigned long dwTime) |
Windows: Windows callback function, calls timerCallback(). | |
Private Attributes | |
int | timerId |
Windows: Timer ID, used to kill the timer in the stop() method. | |
int | timerInterval |
The interval the timer is running at. | |
bool | running |
Whether or not the timer is currently running. |
By Timer, I mean it repeatedly calls timerCallback(), every interval milliseconds.
Note that this relies on the operating system's simple message-based timers, and therefore is not going to be absolutely accurate - generally a 10msec interval is the best you can hope for, and it may fluctuate if the event queue is particularly busy.
|
Constructor.
|
|
Destructor. Will call stop() if the timer is still running. |
|
Call this to start the timer running.
|
|
Called at every interval. Override this with the code you want called periodically. Implemented in ExampleEditor. |