pawengine/types.h

52 lines
984 B
C
Raw Normal View History

2025-02-09 18:48:25 +01:00
#ifndef INCLUDE_WAYLANDCLIENT_TYPES_H_
#define INCLUDE_WAYLANDCLIENT_TYPES_H_
#define PI 3.141592653589793238462643f
// struct vec2 {
// union {
// struct {
// float x, y;
// };
// float arr[2];
// };
// };
struct Vec2 {
float x, y;
};
#define vec2_mul(v, n) \
(struct Vec2) { (v).x *(n), (v).y *(n) }
2025-02-24 20:11:51 +01:00
#define vec2_add(v1, v2) \
(struct Vec2) { (v1).x + (v2).x, (v1).y + (v2).y }
struct Vec2 vec2_normalize(struct Vec2 v);
2025-02-24 20:11:51 +01:00
struct Vec2 vec2_rotate(struct Vec2 v, float alpha);
2025-02-09 18:48:25 +01:00
struct IVec2 {
int x, y;
};
// struct vec3 {
// union {
// struct {
// float x, y, z;
// };
// struct {
// float r, g, b;
// };
// float arr[3];
// };
// };
struct Vec3 {
float x, y, z;
};
struct Vec4 {
float x, y, z, w;
};
struct Vertex {
struct Vec2 pos;
struct Vec3 col;
};
#endif // INCLUDE_WAYLANDCLIENT_TYPES_H_