src/camera.c

changeset 47
44457f6cb0a2
parent 41
df81d493716e
--- a/src/camera.c	Fri Mar 29 00:03:25 2024 +0100
+++ b/src/camera.c	Mon Apr 01 18:54:19 2024 +0200
@@ -27,20 +27,11 @@
 
 #include "ascension/camera.h"
 
-static void asc_camera_update_ortho(AscCamera *camera) {
-    float left = (float) camera->rect.pos.x;
-    float right = left + (float) camera->rect.size.width;
-    float top = (float) camera->rect.pos.y;
-    float bottom = top + (float) camera->rect.size.height;
+void asc_camera_ortho(AscCamera *camera, asc_recti rect) {
+    asc_mat4f_unit(camera->view);
+    float left = (float) rect.pos.x;
+    float right = left + (float) rect.size.width;
+    float top = (float) rect.pos.y;
+    float bottom = top + (float) rect.size.height;
     asc_mat4f_ortho(camera->projection, left, right, bottom, top, -1, 1);
 }
-
-void asc_camera_ortho(AscCamera *camera, asc_recti rect) {
-    asc_mat4f_unit(camera->view);
-    camera->update = asc_camera_update_ortho;
-    camera->rect = rect;
-}
-
-void asc_camera_disable(AscCamera *camera) {
-    camera->update = NULL;
-}

mercurial