made clear_col a vector4

This commit is contained in:
randy 2024-07-01 17:22:10 +07:00
parent dc8c992d4c
commit be6c99dfc5
3 changed files with 6 additions and 7 deletions

View file

@ -197,14 +197,15 @@ inline Matrix4 m4_scale(Matrix4 m, Vector3 scale) {
} }
Matrix4 m4_make_orthographic_projection(float left, float right, float bottom, float top, float near, float far) { // _near & _far because microsoft...
Matrix4 m4_make_orthographic_projection(float left, float right, float bottom, float top, float _near, float _far) {
Matrix4 m = m4_scalar(1.0f); Matrix4 m = m4_scalar(1.0f);
m.m[0][0] = 2.0f / (right - left); m.m[0][0] = 2.0f / (right - left);
m.m[1][1] = 2.0f / (top - bottom); m.m[1][1] = 2.0f / (top - bottom);
m.m[2][2] = -2.0f / (far - near); m.m[2][2] = -2.0f / (_far - _near);
m.m[0][3] = -(right + left) / (right - left); m.m[0][3] = -(right + left) / (right - left);
m.m[1][3] = -(top + bottom) / (top - bottom); m.m[1][3] = -(top + bottom) / (top - bottom);
m.m[2][3] = -(far + near) / (far - near); m.m[2][3] = -(_far + _near) / (_far - _near);
m.m[3][3] = 1.0f; m.m[3][3] = 1.0f;
return m; return m;
} }

View file

@ -115,6 +115,7 @@ void lodepng_free(void* ptr) {
#include "string_format.c" #include "string_format.c"
#include "path_utils.c" #include "path_utils.c"
#include "linmath.c"
#include "os_interface.c" #include "os_interface.c"
#include "gfx_interface.c" #include "gfx_interface.c"
@ -128,7 +129,6 @@ void lodepng_free(void* ptr) {
#include "random.c" #include "random.c"
#include "linmath.c"
#include "memory.c" #include "memory.c"
#include "input.c" #include "input.c"

View file

@ -270,9 +270,7 @@ typedef struct Os_Window {
u32 height; u32 height;
u32 x; u32 x;
u32 y; u32 y;
struct { Vector4 clear_color;
float32 r, g, b, a;
} clear_color;
bool should_close; bool should_close;