summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorClément Sibille <clements@lisible.xyz>2025-03-15 20:54:47 +0100
committerClément Sibille <clements@lisible.xyz>2025-03-15 20:54:47 +0100
commit038c0c44d26a45554e3cc6257bc67d3fecb291cd (patch)
tree10a542754e92b1aedfaddabad946d1cce951ad5e /src/main.c
Initial commit
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c27
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;
+}
Go back to lisible.xyz