#ifndef __FIXED_INTERVAL_RUN_LOOP_H__
#define __FIXED_INTERVAL_RUN_LOOP_H__

typedef struct FixedIntervalRunLoop FixedIntervalRunLoop;

#define FixedIntervalRunLoop_structContents \
	double stepInterval; \
	void (* stepCallback)(void * context); \
	void * stepContext; \
	double lastTime; \
	double slop; \
	\
	void (* dispose)(void * self); \
	void (* run)(void * self);

struct FixedIntervalRunLoop {
	FixedIntervalRunLoop_structContents
};

FixedIntervalRunLoop * FixedIntervalRunLoop_create(double stepInterval, void (* stepCallback)(void *), void * stepContext);
void FixedIntervalRunLoop_init(FixedIntervalRunLoop * self, double stepInterval, void (* stepCallback)(void *), void * stepContext);

void FixedIntervalRunLoop_dispose(void * selfPtr);
void FixedIntervalRunLoop_run(void * selfPtr);

#endif
