viz1090/sdl1090/draw.c
nathan 984fa50fb6 added basic touch gestures
Former-commit-id: 971aea4124910a6ea54b4867d147b436a121961c
Former-commit-id: 87d9093d9e14f0468ebc6294dbbd6a04fa6ac01f
2019-09-08 01:09:14 -05:00

37 lines
693 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);
if (Modes.map) {
drawMap();
drawStatus();
} else {
drawList(10,0);
}
SDL_RenderPresent(game.renderer);
}