src/camera.c

changeset 41
df81d493716e
parent 37
8a8cc6725b48
child 47
44457f6cb0a2
equal deleted inserted replaced
40:6c438be1a1fd 41:df81d493716e
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;

mercurial