summaryrefslogtreecommitdiffhomepage
path: root/src/utils.c
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-07-29 21:57:50 +0200
committerraysan5 <[email protected]>2021-07-29 21:57:50 +0200
commit8b7f43f89b88c75f7353fe85f7cb6465ad6be7b5 (patch)
tree2b3be572cedb63e66a51a83d42e6708bd354195b /src/utils.c
parent58e9a0894f65a50004e637f7db72bd12da809cd9 (diff)
downloadraylib-8b7f43f89b88c75f7353fe85f7cb6465ad6be7b5.tar.gz
raylib-8b7f43f89b88c75f7353fe85f7cb6465ad6be7b5.zip
WARNING: BREAKING CHANGE: rlgl complete decoupling from raylib -WIP-
rlgl has been redesigned to avoid any dependency to `raylib` or `raymath`, all functions using some of those libs have been reviewed. - REMOVED: `Texture2D`, `Shader` structs dependency - REMOVED: `Vector3`, `Matrix` structs dependency - REMOVED: raymath functions dependency, all required math is implemented in rlgl - ADDED: `rlMatrix` custom rlgl type - ADDED: `utils.c`: `rlMatrixFromMatrix()` and `rlMatrixToMatrix()` for a safe conversion between raylib<->rlgl matrix types - ADDED: `rl` prefix to all `rlgl` structs - Other small tweaks here and there
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index dbf4b3bb..4cb09594 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -99,6 +99,29 @@ static int android_close(void *cookie);
//----------------------------------------------------------------------------------
// Module Functions Definition - Utilities
//----------------------------------------------------------------------------------
+rlMatrix rlMatrixFromMatrix(Matrix mat)
+{
+ rlMatrix result = {
+ mat.m0, mat.m4, mat.m8, mat.m12, // Matrix first row (4 comat.mponents)
+ mat.m1, mat.m5, mat.m9, mat.m13, // Matrix second row (4 comat.mponents)
+ mat.m2, mat.m6, mat.m10, mat.m14, // Matrix third row (4 comat.mponents)
+ mat.m3, mat.m7, mat.m11, mat.m15, // Matrix fourth row (4 comat.mponents)
+ };
+
+ return result;
+}
+
+Matrix rlMatrixToMatrix(rlMatrix mat)
+{
+ Matrix result = {
+ mat.m0, mat.m4, mat.m8, mat.m12, // Matrix first row (4 comat.mponents)
+ mat.m1, mat.m5, mat.m9, mat.m13, // Matrix second row (4 comat.mponents)
+ mat.m2, mat.m6, mat.m10, mat.m14, // Matrix third row (4 comat.mponents)
+ mat.m3, mat.m7, mat.m11, mat.m15, // Matrix fourth row (4 comat.mponents)
+ };
+
+ return result;
+}
// Set the current threshold (minimum) log level
void SetTraceLogLevel(int logType) { logTypeLevel = logType; }