add utils
This commit is contained in:
parent
a07c3ddd47
commit
5b53048505
3 changed files with 19 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
// Dimensions de la fenêtre
|
// Dimensions de la fenêtre
|
||||||
extern GLuint _dims[];
|
extern GLuint _dims[];
|
||||||
|
|
9
includes/utils.h
Normal file
9
includes/utils.h
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#ifndef DEMO_UTILS_H
|
||||||
|
#define DEMO_UTILS_H 1
|
||||||
|
|
||||||
|
#include <GL4D/gl4dummies.h>
|
||||||
|
|
||||||
|
// Récupère un delta-temps
|
||||||
|
double get_dt(void);
|
||||||
|
|
||||||
|
#endif
|
9
src/utils.c
Normal file
9
src/utils.c
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#include "../includes/utils.h"
|
||||||
|
|
||||||
|
double get_dt(void) {
|
||||||
|
static double t0 = 0.0f;
|
||||||
|
double t = gl4dGetElapsedTime(), dt = (t - t0) / 1000.0;
|
||||||
|
t0 = t;
|
||||||
|
|
||||||
|
return dt;
|
||||||
|
}
|
Reference in a new issue