src/context.c

changeset 37
8a8cc6725b48
parent 28
8acde7d27904
child 44
b3da4096c607
equal deleted inserted replaced
36:e26b4ac1661c 37:8a8cc6725b48
81 } 81 }
82 82
83 static void asc_event_window_resized(Uint32 id, Sint32 width, Sint32 height) { 83 static void asc_event_window_resized(Uint32 id, Sint32 width, Sint32 height) {
84 for (unsigned int i = 0 ; i < ASC_MAX_WINDOWS ; i++) { 84 for (unsigned int i = 0 ; i < ASC_MAX_WINDOWS ; i++) {
85 if (asc_context.windows[i].id == id) { 85 if (asc_context.windows[i].id == id) {
86 asc_context.windows[i].dimensions.width = width; 86 asc_vec2i dimensions = (asc_vec2i) {width, height};
87 asc_context.windows[i].dimensions.height = height; 87 asc_context.windows[i].resized = true;
88 asc_mat4f_ortho(asc_context.windows[i].projection, 0, (float) width, (float) height, 0); 88 asc_context.windows[i].dimensions = dimensions;
89 asc_context.windows[i].ui.viewport.size = dimensions;
90 asc_context.windows[i].ui.cameras[0].rect.size = dimensions;
89 return; 91 return;
90 } 92 }
91 } 93 }
92 } 94 }
93 95

mercurial