From 56749e237929a26d8ebbd398bc17be7c40f026df Mon Sep 17 00:00:00 2001 From: Quinn Date: Thu, 5 Jun 2025 16:05:37 +0200 Subject: [PATCH] code semantic fixups --- src/io/input.h | 2 +- src/main.c | 7 +++++++ src/util/vec/float2.h | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/io/input.h b/src/io/input.h index a70cba6..2ef4053 100644 --- a/src/io/input.h +++ b/src/io/input.h @@ -1,7 +1,7 @@ // Copyright (c) 2025 Quinn // Licensed under the MIT Licence. See LICENSE for details #pragma once + #include void key_callback(GLFWwindow* win, int key, int scancode, int action, int mods); - diff --git a/src/main.c b/src/main.c index 1b39332..62da5aa 100644 --- a/src/main.c +++ b/src/main.c @@ -5,10 +5,12 @@ #undef GLAD_GL_IMPLEMENTATION #include +#include #include "error.h" #include "io/window.h" + #define WIN_NAME "MCA Selector Lite" #define WIN_DEFAULT_WIDTH 640 #define WIN_DEFAULT_HEIGHT 480 @@ -29,7 +31,12 @@ static inline void quit(void) { int main(int argc, char** argv) { (void)argc, (void)argv; + if (init()) fatal("failed to initialize!"); + window_loop(); quit(); + + // return success, since some architectures do not follow 0=success + return EXIT_SUCCESS; } diff --git a/src/util/vec/float2.h b/src/util/vec/float2.h index 4721cc7..61f5ccf 100644 --- a/src/util/vec/float2.h +++ b/src/util/vec/float2.h @@ -4,7 +4,7 @@ #include "../atrb.h" -// stores a 3D point using a floating-point number +// stores a 2D point using a floating-point number struct float2 { float x; float y; @@ -42,7 +42,7 @@ atrb_const static inline float2 float2_div_s(float2 v, float n) { } atrb_const static inline float2 float2_neg(float2 v) { - return (float2){-v.x, -v.y }; + return (float2){-v.x, -v.y}; } // gets the squared magnitude/length of float2