viz1090/sdl1090/draw.c
nathan 0507fc179b fixed heading, added heading history, switched list mode to overlay (in progress)
Former-commit-id: 0f107d8c372c5a2540f04b315ec9f947ff496fd1
Former-commit-id: 68382a78fc5e92438b70877a3f4497b3404498e9
2019-09-08 14:29:21 -05:00

36 lines
670 B
C

#include "dump1090.h"
#include "structs.h"
#include "SDL2/SDL2_rotozoom.h"
static uint64_t mstime(void) {
struct timeval tv;
uint64_t mst;
gettimeofday(&tv, NULL);
mst = ((uint64_t)tv.tv_sec)*1000;
mst += tv.tv_usec/1000;
return mst;
}
void draw() {
if ((mstime() - Modes.interactive_last_update) < MODES_INTERACTIVE_REFRESH_TIME) {
return;
}
Modes.interactive_last_update = mstime();
updateStatus();
SDL_SetRenderDrawColor( game.renderer, 0, 0, 0, 0);
SDL_RenderClear(game.renderer);
drawMap();
drawStatus();
if(!Modes.map) {
drawList(0);
}
SDL_RenderPresent(game.renderer);
}