2022-06-21 12:48:19 -05:00
|
|
|
#include "timer.h"
|
|
|
|
#include <GLFW/glfw3.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
static double time;
|
|
|
|
|
|
|
|
void timer_init() {
|
|
|
|
time = glfwGetTime();
|
|
|
|
}
|
|
|
|
|
|
|
|
struct timer *timer_make(int interval, void *(*callback)(void *param), void *param) {
|
|
|
|
struct timer *new = malloc(sizeof(*new));
|
|
|
|
new->fire_time = time + interval;
|
|
|
|
|
|
|
|
return new;
|
|
|
|
}
|
|
|
|
|
2022-06-30 10:31:23 -05:00
|
|
|
void timer_pause(struct timer *t) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void timer_start(struct timer *t) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-06-21 12:48:19 -05:00
|
|
|
void timer_remove(struct timer *t) {
|
|
|
|
free(t);
|
|
|
|
}
|