diff options
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 27 | 
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..ffe8369 --- /dev/null +++ b/src/main.c @@ -0,0 +1,27 @@ +#include "log.h" +#include "platform.h" + +int main(void) { +  struct vgltf_platform platform = {}; +  if (!vgltf_platform_init(&platform)) { +    VGLTF_LOG_ERR("Couldn't initialize the platform layer"); +    goto err; +  } + +  while (true) { +    struct vgltf_event event; +    while (vgltf_platform_poll_event(&platform, &event)) { +      if (event.type == VGLTF_EVENT_QUIT || +          (event.type == VGLTF_EVENT_KEY_DOWN && +           event.key.key == VGLTF_KEY_ESCAPE)) { +        goto out_main_loop; +      } +    } +  } +out_main_loop: + +  vgltf_platform_deinit(&platform); +  return 0; +err: +  return 1; +}  | 
