From 476c10961d6ddba806cd9f587fc461c848d27401 Mon Sep 17 00:00:00 2001 From: kotorifan Date: Wed, 15 Apr 2026 19:56:32 +0200 Subject: Displays various texts now --- src/common.h | 51 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 7 deletions(-) (limited to 'src/common.h') diff --git a/src/common.h b/src/common.h index 4b0cdc8..a9ad3d0 100644 --- a/src/common.h +++ b/src/common.h @@ -1,10 +1,47 @@ // common.h -#pragma once +#ifndef COMMON_H +#define COMMON_H + #include -typedef u8 uint8_t_least_t -typedef i8 int8_t_least_t -typedef u16 uint16_least_t -typedef i16 int16_least_t -typedef u32 uint32_least_t -typedef i32 int32_least_t +typedef uint_least8_t u8; +typedef int_least8_t i8; +typedef uint_least16_t u16; +typedef int_least16_t i16; +typedef uint_least32_t u32; +typedef int_least32_t i32; + +typedef struct { + float x; + float y; +} Vec2d; + +// settings +// UI +#define SCREEN_WIDTH 800 +#define SCREEN_HEIGHT 600 +#define SCREEN_TITLE "physics" + +// physics +#define MAX_OBJECTS 100 +#define FORCE_RESITUTION_DEFAULT 0.8f +#define FORCE_GRAVITY_DEFAULT 1000.0f +#define FORCE_LINEAR_DAMPING_DEFAULT 0.995f; + +typedef enum { + SHAPE_CIRCLE, + SHAPE_SQUARE, + SHAPE_RECTANGLE +} shape_t; + +typedef struct { + shape_t type; + Vec2d pos; + Vec2d vel; + Vec2d acc; + float width; + float height; + Color color; +} object_t; + +#endif // COMMON_H -- cgit v1.3