Skip to content

Commit

Permalink
Create main_sdl.c
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmcwatters committed Jul 28, 2023
1 parent ad8668c commit 0053580
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/main_sdl.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* Copyright Planimeter. All Rights Reserved. */

#include "SDL.h"
#include "framework.h"
#include "event.h"
#include "timer.h"
#include "graphics.h"

static void load(int argc, char *argv[])
{
framework_init(argv[0]);
framework_load(argc, argv);
}

static void update()
{
uint64_t dt = timer_step();
framework_update(dt);
}

static void draw()
{
graphics_predraw();
framework_draw();
graphics_postdraw();
graphics_present();
}

int main(int argc, char *argv[])
{
load(argc, argv);

while (event_poll()) {
update();
draw();

timer_sleep(1);
}

return 0;
}

0 comments on commit 0053580

Please sign in to comment.