mirror of
https://github.com/IllusionMan1212/C2048.git
synced 2026-10-24 02:12:31 +00:00
basic game logic with simple translation animation
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
#pragma once
|
||||
|
||||
#include "core.h"
|
||||
|
||||
typedef struct {
|
||||
float m[4][4];
|
||||
} Matrix4x4;
|
||||
|
||||
typedef struct Size {
|
||||
int width;
|
||||
int height;
|
||||
} Size;
|
||||
|
||||
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 {
|
||||
u8 r;
|
||||
u8 g;
|
||||
u8 b;
|
||||
u8 a;
|
||||
} Color;
|
||||
|
||||
typedef struct Colorf {
|
||||
f32 r;
|
||||
f32 g;
|
||||
f32 b;
|
||||
f32 a;
|
||||
} Colorf;
|
||||
|
||||
float to_radians(float degrees);
|
||||
Matrix4x4 identity(void);
|
||||
void mult_4x4(Matrix4x4 *multiplicant, Matrix4x4 *multiplier);
|
||||
void apply_scale(Matrix4x4 *matrix, Sizef scale);
|
||||
void apply_rotation(Matrix4x4 *model, float angle);
|
||||
void apply_translation(Matrix4x4 *matrix, Vec2f pos);
|
||||
Matrix4x4 orthographic_projection_2d(float left, float right, float bottom, float top);
|
||||
Color mul_color(Color color, float amount);
|
||||
Reference in New Issue
Block a user