move typedefs to twn_types.h, specify that twn_vec.h is C user only, remove Vec2sh

This commit is contained in:
2024-10-07 15:55:53 +03:00
parent 8463ed4440
commit e2f5d44959
2 changed files with 42 additions and 53 deletions

View File

@ -39,4 +39,42 @@ typedef struct Matrix4 {
Vec4 row[4];
} Matrix4;
/* a point in some space (integer) */
typedef struct Vec2i {
_Alignas(8)
int32_t x;
int32_t y;
} Vec2i;
/* a point in some space (floating point) */
typedef struct Vec2 {
_Alignas(8)
float x;
float y;
} Vec2;
/* a point in some three dimension space (floating point) */
/* y goes up, x goes to the right */
typedef struct Vec3 {
_Alignas(16)
float x;
float y;
float z;
} Vec3;
/* a point in some three dimension space (floating point) */
/* y goes up, x goes to the right */
typedef struct Vec4 {
_Alignas(16)
float x;
float y;
float z;
float w;
} Vec4;
#endif