| 223 | } |
| 224 | |
| 225 | void common_update() { |
| 226 | static app_focus_ prev_focus = app_focus_hidden; |
| 227 | app_focus_ curr_focus = sk_app_focus(); |
| 228 | if (curr_focus != prev_focus) { |
| 229 | switch (curr_focus) { |
| 230 | case app_focus_active: log_write(log_diagnostic, "Focus: Active"); break; |
| 231 | case app_focus_background: log_write(log_diagnostic, "Focus: Background"); break; |
| 232 | case app_focus_hidden: log_write(log_diagnostic, "Focus: Hidden"); break; |
| 233 | } |
| 234 | prev_focus = curr_focus; |
| 235 | } |
| 236 | |
| 237 | scene_update(); |
| 238 | |
| 239 | // Render floor |
| 240 | if (sk_system_info().display_type == display_opaque) |
| 241 | render_add_model(floor_model, floor_tr); |
| 242 | |
| 243 | ui_window_begin("Demos", demo_select_pose, vec2{50*cm2m, 0*cm2m}); |
| 244 | for (int i = 0; i < sizeof(demos) / sizeof(scene_t); i++) { |
| 245 | std::string &name = demos[i].name; |
| 246 | |
| 247 | ui_sameline(); |
| 248 | |
| 249 | if (ui_button(name.c_str())) { |
| 250 | log_write(log_inform, name.c_str()); |
| 251 | scene_set_active(demos[i]); |
| 252 | } |
| 253 | } |
| 254 | #if !defined(__EMSCRIPTEN__) |
| 255 | ui_hseparator(); |
| 256 | if (ui_button("Exit") || (input_key(key_esc) & button_state_just_active)) sk_quit(); |
| 257 | #endif |
| 258 | ui_window_end(); |
| 259 | |
| 260 | ruler_window(); |
| 261 | log_window(); |
| 262 | } |
| 263 | |
| 264 | void common_shutdown() { |
| 265 | scene_shutdown(); |
nothing calls this directly
no test coverage detected