Add Core compiler interface

This commit is contained in:
Krzosa Karol
2022-12-31 14:47:47 +01:00
parent 673db72e29
commit 23db7cc5c4
13 changed files with 607 additions and 2373 deletions

View File

@@ -138,6 +138,7 @@ typedef double F64;
#define JOIN(X,Y) JOIN1(X,Y)
#define string_expand(x) (int)x.len, x.str
#define CORE_STRINGS
struct String{
U8 *str;
S64 len;
@@ -154,78 +155,6 @@ global String string_null = {(U8 *)"null", 4};
#include "stb_sprintf.h"
#define snprintf stbsp_snprintf
union Vec2 {
struct { F32 x, y; };
struct { F32 width, height; };
F32 p[2];
};
union Vec3 {
struct{ F32 x, y, z; };
struct{ F32 r, g, b; };
struct{ Vec2 xy; F32 z_; };
struct{ F32 x_; Vec2 yz; };
F32 p[3];
};
union Vec4 {
struct{ F32 x, y, z, w; };
struct{ F32 r, g, b, a; };
struct{ Vec2 xy; Vec2 zw; };
struct{ Vec2 xy_; F32 width, height; };
struct{ Vec3 xyz; F32 w_; };
struct{ F32 x_; Vec3 yzw; };
struct{ Vec3 rgb; F32 a_; };
F32 p[4];
};
struct Mat4 {
F32 p[4][4];
};
union Vec1I {
S32 x;
S32 p[1];
};
union Vec2I {
struct { S32 x, y; };
struct { S32 width, height; };
S32 p[2];
};
union Vec3I {
struct { S32 x, y, z; };
struct { S32 r, g, b; };
struct { Vec2I xy; S32 z_; };
struct { S32 x_; Vec2I yz; };
S32 p[3];
};
union Vec4I {
struct { S32 x, y, z, w; };
struct { S32 r, g, b, a; };
struct { Vec2I xy; Vec2I zw; };
struct { Vec2I xy_; S32 width, height; };
struct { Vec3I xyz; S32 w_; };
struct { S32 x_; Vec3I yzw; };
struct { Vec3I rgb; S32 a_; };
S32 p[4];
};
union Rect2 {
struct {F32 min_x, min_y, max_x, max_y;};
struct { Vec2 min; Vec2 max; };
F32 p[4];
};
union Rect2I {
struct { S32 min_x, min_y, max_x, max_y;};
struct { Vec2I min; Vec2I max; };
S32 p[4];
};
//-----------------------------------------------------------------------------
// Utilities
//-----------------------------------------------------------------------------