1v13d/src/FxEngine/FxEngine.c

48 lines
770 B
C
Raw Normal View History

2019-07-20 16:03:28 +02:00
#include "FxEngine.h"
2019-07-21 16:32:43 +02:00
2019-07-20 16:47:37 +02:00
#include <libprof.h>
2019-07-21 20:14:54 +02:00
#include "coord.h"
#include <stdbool.h>
#include <gint/display.h>
FE_position FE_user={0,0,0};
double FE_dh,FE_dv,FE_roulis;
2019-07-20 16:03:28 +02:00
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
2019-07-21 20:14:54 +02:00
static void FE_move() // call at each frame
{
// TODO with math functions, not implemented yet !
// TODO insert physical engine
}
void FE_new_frame(void)
2019-07-20 16:03:28 +02:00
{
2019-07-20 16:47:37 +02:00
if (loaded_before)
2019-07-21 20:14:54 +02:00
{
2019-07-20 16:47:37 +02:00
prof_leave(0);
2019-07-21 20:14:54 +02:00
}
2019-07-20 16:47:37 +02:00
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);
2019-07-20 16:03:28 +02:00
FE_move(); // Not implemented yet !
2019-07-21 20:14:54 +02:00
FE_set_matrice();
2019-07-21 21:27:02 +02:00
//FE_zbuffer_clear(); // Not implemented yet !
2019-07-20 16:03:28 +02:00
2019-07-21 20:14:54 +02:00
//dupdate();
//dclear();
2019-07-20 16:03:28 +02:00
}
2019-07-21 20:14:54 +02:00
int FE_get_fps(void)
2019-07-21 21:27:02 +02:00
{return 1000000/frame_interval;}
2019-07-20 16:47:37 +02:00
2019-07-21 20:14:54 +02:00