summaryrefslogtreecommitdiff
path: root/libs/pwyazh/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pwyazh/types.h')
-rw-r--r--libs/pwyazh/types.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/libs/pwyazh/types.h b/libs/pwyazh/types.h
new file mode 100644
index 0000000..1e16449
--- /dev/null
+++ b/libs/pwyazh/types.h
@@ -0,0 +1,74 @@
+#ifndef TYPES_H
+#define TYPES_H
+
+/* NOTE(pryazha): Basic types */
+
+#include <stdint.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;
+
+typedef struct {
+ F32 x, y;
+} V2F;
+
+typedef struct {
+ F32 x, y, z;
+} V3F;
+
+typedef struct {
+ F32 x, y, z, w;
+} V4F;
+
+/* NOTE(pryazha): column-major order */
+typedef struct {
+ V4F m0, m1, m2, m3;
+} MAT4;
+
+typedef struct {
+ U8 *memory;
+ U64 capacity;
+ U64 used;
+} Arena;
+
+/* NOTE(pryazha): String types */
+typedef struct {
+ U8 *str;
+ U64 size;
+} String8;
+
+typedef struct {
+ struct String8Node *next;
+ String8 string;
+} String8Node;
+
+typedef struct {
+ String8Node *first;
+ String8Node *last;
+} String8List;
+
+typedef struct {
+ V3F pos;
+ V3F normal;
+ V2F tex_coords;
+} Vertex;
+
+typedef struct {
+ U32 vao;
+ Vertex *vertices;
+ U32 vertex_count;
+ U32 *indices;
+ U32 index_count;
+} Mesh;
+
+static F32 pi_F32 = 3.14159265359f;
+
+#endif /* TYPES_H */