summaryrefslogtreecommitdiff
path: root/prb_types.h
diff options
context:
space:
mode:
authorpryazha <pryadeiniv@mail.ru>2025-03-19 08:44:10 +0500
committerpryazha <pryadeiniv@mail.ru>2025-03-19 08:44:10 +0500
commitaa00f2f2d7cc70edb45726dc21d359bc05036387 (patch)
tree7f55503104c7c5beda23637408c32c19d013c335 /prb_types.h
parent0bd7c5dc0725a4882cb33c5d8f1a3b101d4025cd (diff)
mainly string change
Diffstat (limited to 'prb_types.h')
-rw-r--r--prb_types.h87
1 files changed, 45 insertions, 42 deletions
diff --git a/prb_types.h b/prb_types.h
index a1ac3ba..bfcafcc 100644
--- a/prb_types.h
+++ b/prb_types.h
@@ -1,84 +1,87 @@
#ifndef PRB_TYPES_H
#define PRB_TYPES_H
-typedef int8_t S8;
-typedef int16_t S16;
-typedef int32_t S32;
-typedef int64_t S64;
-typedef uint8_t U8;
-typedef uint16_t U16;
-typedef uint32_t U32;
-typedef uint64_t U64;
-typedef S32 B32;
-typedef float F32;
-typedef double F64;
-
-/* NOTE(pryazha): The library uses a right-handed coordiante system (for now) */
+typedef int8_t S8;
+typedef int16_t S16;
+typedef int32_t S32;
+typedef int64_t S64;
+
+typedef uint8_t U8;
+typedef uint16_t U16;
+typedef uint32_t U32;
+typedef uint64_t U64;
+
+typedef S32 B32;
+
+typedef float F32;
+typedef double F64;
+
+/* NOTE(pryazha): The library only use right-handed coordiante system (for now) */
typedef struct {
F32 x, y;
} V2;
-#define V2_ZERO (V2){ 0.0f, 0.0f }
-#define V2_ONE (V2){ 1.0f, 1.0f }
-#define V2_RIGHT (V2){ 1.0f, 0.0f }
-#define V2_UP (V2){ 0.0f, 1.0f }
-#define V2_LEFT (V2){-1.0f, 0.0f }
-#define V2_DOWN (V2){ 0.0f, -1.0f }
+#define V2_ZERO (V2){ 0.0f, 0.0f }
+#define V2_ONE (V2){ 1.0f, 1.0f }
+#define V2_RIGHT (V2){ 1.0f, 0.0f }
+#define V2_UP (V2){ 0.0f, 1.0f }
+#define V2_LEFT (V2){-1.0f, 0.0f }
+#define V2_DOWN (V2){ 0.0f, -1.0f }
typedef struct {
F32 x, y, z;
} V3;
-#define V3_ZERO (V3){ 0.0f, 0.0f, 0.0f }
-#define V3_ONE (V3){ 1.0f, 1.0f, 1.0f }
-#define V3_RIGHT (V3){ 1.0f, 0.0f, 0.0f }
-#define V3_UP (V3){ 0.0f, 1.0f, 0.0f }
-#define V3_LEFT (V3){-1.0f, 0.0f, 0.0f }
-#define V3_DOWN (V3){ 0.0f, -1.0f, 0.0f }
-#define V3_FORWARD (V3){ 0.0f, 0.0f, 1.0f }
-#define V3_BACKWARD (V3){ 0.0f, 0.0f, -1.0f }
+#define V3_ZERO (V3){ 0.0f, 0.0f, 0.0f }
+#define V3_ONE (V3){ 1.0f, 1.0f, 1.0f }
+#define V3_RIGHT (V3){ 1.0f, 0.0f, 0.0f }
+#define V3_UP (V3){ 0.0f, 1.0f, 0.0f }
+#define V3_LEFT (V3){-1.0f, 0.0f, 0.0f }
+#define V3_DOWN (V3){ 0.0f, -1.0f, 0.0f }
+#define V3_FORWARD (V3){ 0.0f, 0.0f, 1.0f }
+#define V3_BACKWARD (V3){ 0.0f, 0.0f, -1.0f }
typedef struct {
F32 x, y, z, w;
} V4;
-#define V4_ZERO (V4){ 0.0f, 0.0f, 0.0f, 0.0f }
-#define V4_ONE (V4){ 1.0f, 1.0f, 1.0f, 1.0f }
+#define V4_ZERO (V4){ 0.0f, 0.0f, 0.0f, 0.0f }
+#define V4_ONE (V4){ 1.0f, 1.0f, 1.0f, 1.0f }
typedef struct {
V4 m0, m1, m2, m3;
-} Mat4;
+} MAT4;
-#define MAT4_IDENTITY (Mat4) { \
+#define MAT4_IDENTITY (MAT4) { \
{ 1.0f, 0.0f, 0.0f, 0.0f }, \
{ 0.0f, 1.0f, 0.0f, 0.0f }, \
{ 0.0f, 0.0f, 1.0f, 0.0f }, \
{ 0.0f, 0.0f, 0.0f, 1.0f } }
typedef struct {
- U8 *mem;
- U64 cap;
- U64 used;
+ U8 *mem;
+ U64 cap;
+ U64 used;
} Arena;
/* NOTE(pryazha): Strings */
typedef struct {
- U8 *ptr;
- U64 length;
+ U8 *ptr;
+ U64 length;
} Str8;
typedef struct Str8Node {
- Str8 str;
- struct Str8Node *next;
+ Str8 str;
+ struct Str8Node *next;
struct Str8Node *prev;
} Str8Node;
typedef struct {
- Str8Node *first;
- Str8Node *last;
- U64 total_length;
- U32 node_count;
+ Str8Node *first;
+ Str8Node *last;
+ U64 total_length;
+ U32 node_count;
} Str8List;
#endif /* PRB_TYPES_H */