diff options
| author | kotorifan <kotorifan05@gmail.com> | 2026-04-15 19:56:32 +0200 |
|---|---|---|
| committer | kotorifan <kotorifan05@gmail.com> | 2026-04-15 19:56:32 +0200 |
| commit | 476c10961d6ddba806cd9f587fc461c848d27401 (patch) | |
| tree | f0023add0c4d85668dd33fb05e5e7d128d892572 /src/common.h | |
| parent | b38ff486555a16840fd04caaa3cbe38e37b2b9ae (diff) | |
| download | trashbinphysics-476c10961d6ddba806cd9f587fc461c848d27401.tar.gz | |
Displays various texts now
Diffstat (limited to 'src/common.h')
| -rw-r--r-- | src/common.h | 51 |
1 files changed, 44 insertions, 7 deletions
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 <stdint.h> -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 |
