1v13d/src/FxEngine/FxEngine.c

38 lines
726 B
C
Raw Normal View History

2019-07-20 16:03:28 +02:00
#include "FxEngine.h"
2019-07-20 16:47:37 +02:00
#include <libprof.h>
2019-07-20 16:03:28 +02:00
#include <display.h>
2019-07-20 16:47:37 +02:00
static uint32_t frame_interval=0; // in milliseconds
static bool loaded_before=false;
2019-07-20 16:03:28 +02:00
void FE_new_frame()
{
2019-07-20 16:47:37 +02:00
if (loaded_before)
prof_leave(0);
else
{
prof_init(1,0);
loaded_before=true;
}
frame_interval=prof_time(0);
2019-07-20 16:53:07 +02:00
prof_clear(0);
2019-07-20 16:47:37 +02:00
prof_enter(0);
// add frame changing -- with timeGR, wait answer on Planete Casio
2019-07-20 16:03:28 +02:00
FE_move(); // Not implemented yet !
FE_zbuffer_clear(); // Not implemented yet !
dupdate();
dclear();
}
2019-07-20 16:47:37 +02:00
int FE_get_fps()
{return 1000/frame_interval;}
2019-07-20 16:03:28 +02:00
static void FE_move() // call at each frame
{
// TODO with math functions, not implemented yet !
2019-07-20 17:52:00 +02:00
FE_set_matrice(FE_dh,FE_dv,FR_roulis);
2019-07-20 16:03:28 +02:00
// TODO insert physical engine
2019-07-20 16:12:33 +02:00
}