51 lines
984 B
C
51 lines
984 B
C
#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) }
|
|
#define vec2_add(v1, v2) \
|
|
(struct Vec2) { (v1).x + (v2).x, (v1).y + (v2).y }
|
|
struct Vec2 vec2_normalize(struct Vec2 v);
|
|
struct Vec2 vec2_rotate(struct Vec2 v, float alpha);
|
|
|
|
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_
|