aboutsummaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorMarvin Borner2021-02-17 22:13:59 +0100
committerMarvin Borner2021-02-18 18:03:43 +0100
commite28ea65105c4afd3a3dea7d050b392565d15120d (patch)
treef3c1eaf8c4da5d71893355db1779d73d98f68d2f /libc
parentb32cb0a22db893c106cb86ca0f1178d5da05b551 (diff)
Started GUI rewrite
It's a mess right now..
Diffstat (limited to 'libc')
-rw-r--r--libc/inc/sys.h4
-rw-r--r--libc/inc/vec.h4
2 files changed, 6 insertions, 2 deletions
diff --git a/libc/inc/sys.h b/libc/inc/sys.h
index aead212..be4352f 100644
--- a/libc/inc/sys.h
+++ b/libc/inc/sys.h
@@ -29,13 +29,13 @@ enum sys {
};
struct event_keyboard {
- int magic;
+ u32 magic;
int press;
int scancode;
};
struct event_mouse {
- int magic;
+ u32 magic;
int diff_x;
int diff_y;
int but1;
diff --git a/libc/inc/vec.h b/libc/inc/vec.h
index 9eb706c..024e792 100644
--- a/libc/inc/vec.h
+++ b/libc/inc/vec.h
@@ -13,6 +13,8 @@ typedef struct vec3 {
u32 x, y, z;
} vec3;
+#define vec2(x, y) ((vec2){ x, y })
+#define vec2to3(a, z) ((vec3){ a.x, a.y, z })
#define vec2_add(a, b) ((vec2){ a.x + b.x, a.y + b.y })
#define vec2_sub(a, b) ((vec2){ a.x - b.x, a.y - b.y })
#define vec2_mul(a, b) ((vec2){ a.x * b, a.y * b })
@@ -20,6 +22,8 @@ typedef struct vec3 {
#define vec2_dot(a, b) ((u32)(a.x * b.x + a.y * b.y))
#define vec2_eq(a, b) (a.x == b.x && a.y == b.y)
+#define vec3(x, y, z) ((vec3){ x, y, z })
+#define vec3to2(a) ((vec2){ a.x, a.y })
#define vec3_add(a, b) ((vec3){ a.x + b.x, a.y + b.y, a.z + b.z })
#define vec3_sub(a, b) ((vec3){ a.x - b.x, a.y - b.y, a.z - b.z })
#define vec3_mul(a, b) ((vec3){ a.x * b, a.y * b, a.z * b })