test/snake/snake.c

changeset 175
e5544920377e
parent 173
bd57fe3f6360
equal deleted inserted replaced
174:0009b982bc7d 175:e5544920377e
142 offset_y = (window_size.height - window_size.width) / 2; 142 offset_y = (window_size.height - window_size.width) / 2;
143 viewport_size = window_size.width; 143 viewport_size = window_size.width;
144 } 144 }
145 145
146 // Set the viewport to the scaled and centered region 146 // Set the viewport to the scaled and centered region
147 return asc_recti_new(offset_x, offset_y, viewport_size, viewport_size); 147 return ASC_RECTI(offset_x, offset_y, viewport_size, viewport_size);
148 } 148 }
149 149
150 int main(void) { 150 int main(void) {
151 asc_context_initialize(); 151 asc_context_initialize();
152 if (asc_has_error()) { 152 if (asc_has_error()) {
177 .projection_update_func = asc_camera_ortho_update_size 177 .projection_update_func = asc_camera_ortho_update_size
178 ); 178 );
179 asc_ink_rgb(0, 128, 90); 179 asc_ink_rgb(0, 128, 90);
180 asc_scene_init(MAIN_SCENE, 180 asc_scene_init(MAIN_SCENE,
181 .type = ASC_CAMERA_ORTHO, 181 .type = ASC_CAMERA_ORTHO,
182 .ortho.rect = asc_recti_new(0, 0, game_field_size, game_field_size), 182 .ortho.rect = ASC_RECTI(0, 0, game_field_size, game_field_size),
183 .viewport_clear = true, 183 .viewport_clear = true,
184 .viewport_update_func = update_viewport_for_window_resize 184 .viewport_update_func = update_viewport_for_window_resize
185 ); 185 );
186 186
187 // backdrop for letterbox/pillarbox 187 // backdrop for letterbox/pillarbox

mercurial