src/context.c

changeset 147
4908cc6c2e01
parent 141
cd82643bb6d9
equal deleted inserted replaced
146:bd62381be983 147:4908cc6c2e01
198 asc_context.input.keys[event.key.keysym.scancode] = ASC_KEY_RELEASE_FLAG; 198 asc_context.input.keys[event.key.keysym.scancode] = ASC_KEY_RELEASE_FLAG;
199 break; 199 break;
200 } 200 }
201 } 201 }
202 202
203 // sync the windows
204 for (unsigned int i = 0 ; i < ASC_MAX_WINDOWS ; i++) {
205 asc_window_sync(i);
206 }
207
208 // compute frame time 203 // compute frame time
209 uint64_t frame_nanos, ns; 204 uint64_t frame_nanos, ns;
210 do { 205 do {
211 ns = asc_nanos(); 206 ns = asc_nanos();
212 frame_nanos = ns - asc_context.total_nanos; 207 frame_nanos = ns - asc_context.total_nanos;
213 } while (frame_nanos == 0); 208 } while (frame_nanos == 0);
214 asc_context.frame_nanos = frame_nanos; 209 asc_context.frame_nanos = frame_nanos;
215 asc_context.total_nanos = ns; 210 asc_context.total_nanos = ns;
216 211
212 // sync the windows
213 for (unsigned int i = 0 ; i < ASC_MAX_WINDOWS ; i++) {
214 asc_window_sync(i);
215 }
216
217 return !asc_test_flag(asc_context.flags, ASC_FLAG_QUIT); 217 return !asc_test_flag(asc_context.flags, ASC_FLAG_QUIT);
218 } 218 }
219 219
220 void asc_set_font_path(const char *path) { 220 void asc_set_font_path(const char *path) {
221 cx_strcpy(&asc_context.font_path, cx_str(path)); 221 cx_strcpy(&asc_context.font_path, cx_str(path));

mercurial