2023-11-17 06:16:32 +02:00
|
|
|
#pragma once
|
2023-10-02 23:59:48 +02:00
|
|
|
|
2023-11-29 01:42:44 +02:00
|
|
|
typedef struct {
|
|
|
|
|
float m[4][4];
|
|
|
|
|
} Matrix4x4;
|
2023-11-23 04:05:15 +02:00
|
|
|
|
2023-11-29 01:42:44 +02:00
|
|
|
typedef struct Size {
|
|
|
|
|
int width;
|
|
|
|
|
int height;
|
|
|
|
|
} Size;
|
2023-10-02 23:59:48 +02:00
|
|
|
|
2023-11-29 01:42:44 +02:00
|
|
|
typedef struct Sizef {
|
|
|
|
|
float width;
|
|
|
|
|
float height;
|
|
|
|
|
} Sizef;
|
|
|
|
|
|
|
|
|
|
typedef struct Vec2 {
|
|
|
|
|
int x;
|
|
|
|
|
int y;
|
|
|
|
|
} Vec2;
|
|
|
|
|
|
|
|
|
|
typedef struct Vec2f {
|
|
|
|
|
float x;
|
|
|
|
|
float y;
|
|
|
|
|
} Vec2f;
|
|
|
|
|
|
|
|
|
|
typedef struct Vec4f {
|
|
|
|
|
float x;
|
|
|
|
|
float y;
|
|
|
|
|
float z;
|
|
|
|
|
float w;
|
|
|
|
|
} Vec4f;
|
|
|
|
|
|
|
|
|
|
typedef struct Color {
|
|
|
|
|
float r;
|
|
|
|
|
float g;
|
|
|
|
|
float b;
|
|
|
|
|
float a;
|
|
|
|
|
} Color;
|
|
|
|
|
|
|
|
|
|
float to_radians(float degrees);
|
2023-11-21 02:52:15 +02:00
|
|
|
Matrix4x4 identity();
|
2023-11-21 22:29:02 +02:00
|
|
|
void mult_4x4(Matrix4x4 *multiplicant, Matrix4x4 *multiplier);
|
2023-11-22 01:29:21 +02:00
|
|
|
void apply_scale(Matrix4x4 *matrix, Sizef scale);
|
2023-11-21 22:29:02 +02:00
|
|
|
void apply_rotation(Matrix4x4 *model, float angle);
|
2023-11-22 01:29:21 +02:00
|
|
|
void apply_translation(Matrix4x4 *matrix, Vec2f pos);
|
2023-10-05 23:02:23 +02:00
|
|
|
Matrix4x4 orthographic_projection_2d(float left, float right, float bottom, float top);
|