30 static void asc_camera_update_ortho(AscCamera *camera) { |
30 static void asc_camera_update_ortho(AscCamera *camera) { |
31 float left = (float) camera->rect.pos.x; |
31 float left = (float) camera->rect.pos.x; |
32 float right = left + (float) camera->rect.size.width; |
32 float right = left + (float) camera->rect.size.width; |
33 float top = (float) camera->rect.pos.y; |
33 float top = (float) camera->rect.pos.y; |
34 float bottom = top + (float) camera->rect.size.height; |
34 float bottom = top + (float) camera->rect.size.height; |
35 asc_mat4f_ortho(camera->projection, left, right, bottom, top); |
35 asc_mat4f_ortho(camera->projection, left, right, bottom, top, -1, 1); |
36 } |
36 } |
37 |
37 |
38 void asc_camera_ortho(AscCamera *camera, asc_recti rect) { |
38 void asc_camera_ortho(AscCamera *camera, asc_recti rect) { |
39 asc_mat4f_unit(camera->view); |
39 asc_mat4f_unit(camera->view); |
40 camera->update = asc_camera_update_ortho; |
40 camera->update = asc_camera_update_ortho; |