added help overlay

This commit is contained in:
2023-10-02 23:59:48 +02:00
parent f0ce9a26f3
commit 938d0e67cb
8 changed files with 158 additions and 7 deletions
+21
View File
@@ -0,0 +1,21 @@
#include "helper.h"
Matrix4x4 orthographicProjection2D(float left, float right, float bottom, float top) {
Matrix4x4 result;
// Identity matrix
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
result.m[i][j] = 0.0f;
}
}
result.m[0][0] = 2.0f / (right - left);
result.m[3][0] = -(right + left) / (right - left);
result.m[1][1] = 2.0f / (top - bottom);
result.m[3][1] = -(top + bottom) / (top - bottom);
result.m[2][2] = -1.0f;
result.m[3][3] = 1.0f;
return result;
}