summaryrefslogtreecommitdiff
path: root/prb_types.h
diff options
context:
space:
mode:
Diffstat (limited to 'prb_types.h')
-rw-r--r--prb_types.h117
1 files changed, 35 insertions, 82 deletions
diff --git a/prb_types.h b/prb_types.h
index 8760513..bf6cd43 100644
--- a/prb_types.h
+++ b/prb_types.h
@@ -1,96 +1,49 @@
-#ifndef PRB_TYPES_H
-#define PRB_TYPES_H
+typedef int8_t i8;
+typedef int16_t i16;
+typedef int32_t i32;
+typedef int64_t i64;
-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 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) */
-
-#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 float f32;
+typedef double f64;
typedef struct {
- F32 x;
- F32 y;
-} V2;
-
-#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 }
+ f32 x;
+ f32 y;
+} v2;
typedef struct {
- F32 x;
- F32 y;
- F32 z;
-} V3;
-
-#define V4_ZERO (V4){ 0.0f, 0.0f, 0.0f, 0.0f }
-#define V4_ONE (V4){ 1.0f, 1.0f, 1.0f, 1.0f }
+ f32 x;
+ f32 y;
+ f32 z;
+} v3;
typedef struct {
- F32 x;
- F32 y;
- F32 z;
- F32 w;
-} V4;
-
-#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 } }
+ f32 x;
+ f32 y;
+ f32 z;
+ f32 w;
+} v4;
+// column-major
typedef struct {
- V4 m0;
- V4 m1;
- V4 m2;
- V4 m3;
-} MAT4;
+ v4 c0;
+ v4 c1;
+ v4 c2;
+ v4 c3;
+} mat4;
typedef struct {
- U8 *mem;
- U64 cap;
- U64 used;
-} Arena;
-
-/* NOTE(pryazha): Fixed-length string */
-typedef struct {
- U8 *p;
- U64 len;
-} FLS;
-
-typedef struct FLSNode {
- FLS str;
- struct FLSNode *next;
- struct FLSNode *prev;
-} FLSNode;
+ v2 start;
+ v2 end;
+} rect_t;
typedef struct {
- struct FLSNode *first;
- struct FLSNode *last;
- U64 len;
- U32 ncnt;
-} FLSList;
-
-#endif /* PRB_TYPES_H */
+ void *memory;
+ u64 capacity;
+ u64 used;
+} arena_t;