1v13d/src/FxEngine/FxEngine.c

48 lines
766 B
C

#include "FxEngine.h"
#include <libprof.h>
#include "coord.h"
#include <stdbool.h>
#include <gint/display.h>
FE_position FE_user={0,0,0};
double FE_dh,FE_dv,FE_roulis;
static uint32_t frame_interval=0; // in milliseconds
static bool loaded_before=false;
static void FE_move() // call at each frame
{
// TODO with math functions, not implemented yet !
// TODO insert physical engine
}
void FE_new_frame(void)
{
if (loaded_before)
{
prof_leave(0);
}
else
{
prof_init(1,0);
loaded_before=true;
}
frame_interval=prof_time(0);
prof_clear(0);
prof_enter(0);
FE_move(); // Not implemented yet !
FE_set_matrice();
//FE_zbuffer_clear(); // Not implemented yet !
dupdate();
dclear();
}
int FE_get_fps(void)
{return 1000000/frame_interval;}