comparison nuklear_ui/blastem_nuklear.c @ 1862:e07fc3d473b2

Basic UI navigation with controller
author Michael Pavone <pavone@retrodev.com>
date Wed, 08 May 2019 23:44:40 -0700
parents 52f136052ab0
children 93960907807a
comparison
equal deleted inserted replaced
1861:fc05f49075c2 1862:e07fc3d473b2
1999 } 1999 }
2000 } 2000 }
2001 2001
2002 void ui_idle_loop(void) 2002 void ui_idle_loop(void)
2003 { 2003 {
2004 render_enable_gamepad_events(1);
2004 const uint32_t MIN_UI_DELAY = 15; 2005 const uint32_t MIN_UI_DELAY = 15;
2005 static uint32_t last; 2006 static uint32_t last;
2006 while (current_view != view_play) 2007 while (current_view != view_play)
2007 { 2008 {
2008 uint32_t current = render_elapsed_ms(); 2009 uint32_t current = render_elapsed_ms();
2015 if (config_dirty) { 2016 if (config_dirty) {
2016 apply_updated_config(); 2017 apply_updated_config();
2017 persist_config(config); 2018 persist_config(config);
2018 config_dirty = 0; 2019 config_dirty = 0;
2019 } 2020 }
2021 render_enable_gamepad_events(0);
2020 } 2022 }
2021 static void handle_event(SDL_Event *event) 2023 static void handle_event(SDL_Event *event)
2022 { 2024 {
2023 if (event->type == SDL_KEYDOWN) { 2025 if (event->type == SDL_KEYDOWN) {
2024 keycode = event->key.keysym.sym; 2026 keycode = event->key.keysym.sym;