summaryrefslogtreecommitdiffstats
path: root/src/main.c
blob: ffe83691b8031b9d052acb89bb60034eb266f099 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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;
}
Go back to lisible.xyz