src/camera.c

changeset 262
b47de42f4598
parent 256
60014484121c
equal deleted inserted replaced
261:bfd15f5a3948 262:b47de42f4598
60 } 60 }
61 61
62 void asc_camera_ortho_update_size(AscCamera *camera, asc_vec2u size) { 62 void asc_camera_ortho_update_size(AscCamera *camera, asc_vec2u size) {
63 asc_mat4f_ortho_update_size(camera->projection, (float)size.width, (float)size.height); 63 asc_mat4f_ortho_update_size(camera->projection, (float)size.width, (float)size.height);
64 } 64 }
65
66 void asc_camera_update_viewport(AscCamera *camera, asc_vec2u window_size) {
67 if (camera->viewport_update_func == NULL) {
68 // this assumes the viewport was initialized with zeros!
69 camera->viewport.size = window_size;
70 } else {
71 camera->viewport = camera->viewport_update_func(window_size);
72 }
73 if (camera->projection_update_func != NULL) {
74 camera->projection_update_func(camera, window_size);
75 }
76 }

mercurial