diff --git a/basegraph.cpp b/basegraph.cpp index 4dcc07cd..28feeafa 100644 --- a/basegraph.cpp +++ b/basegraph.cpp @@ -1325,7 +1325,9 @@ EX void close_window() { EX void close_sdl() { close_window(); + #if CAP_SDL SDL_Quit(); + #endif sdl_on = false; graphics_on = false; vid.usingGL = false; diff --git a/config.cpp b/config.cpp index 87af51ff..56414635 100644 --- a/config.cpp +++ b/config.cpp @@ -1077,6 +1077,7 @@ EX purehookset hooks_configfile; EX ld mapfontscale = 100; +#if CAP_SDL EX vector get_display_modes(char which) { set seen; @@ -1119,6 +1120,7 @@ EX vector get_display_modes(char which) { for(auto s: seen) v.push_back(s); return v; } +#endif #if CAP_SDLTTF EX void font_reaction() { @@ -1480,14 +1482,18 @@ EX void initConfig() { param_i(vid.fullscreen_x, "fullscreen_x", 1280) -> editable(640, 3840, 1, "fullscreen resolution to use (X)", "", 'x') -> set_sets([] { + #if CAP_SDL dialog::scale_given(get_display_modes('x')); + #endif dialog::bound_low(dialog::get_ne().vmin); dialog::get_di().reaction_final = do_request_resolution_change; }); param_i(vid.fullscreen_y, "fullscreen_y", running_on_deck ? 800 : 1024) -> editable(480, 2160, 1, "fullscreen resolution to use (Y)", "", 'x') -> set_sets([] { + #if CAP_SDL dialog::scale_given(get_display_modes('y')); + #endif dialog::bound_low(dialog::get_ne().vmin); dialog::get_di().reaction_final = do_request_resolution_change; }); diff --git a/control.cpp b/control.cpp index 329c10c6..bfeb8dda 100644 --- a/control.cpp +++ b/control.cpp @@ -965,6 +965,12 @@ EX bool is_joy_index(int sym, int index) { return is_joy_any(sym) && (sym & (JOY_ID - 1)) == index; } +#endif + +#if !CAP_SDL +EX bool is_joy_index(int sym, int index) { return false; } +#endif + #if HDR // default meaning of Steam Deck buttons @@ -985,6 +991,7 @@ namespace deck { } #endif +#if CAP_SDL EX void mainloopiter() { indenter_finish imainloop(debug_control, "mainloopiter"); GLWRAP; diff --git a/dialogs.cpp b/dialogs.cpp index 3f97104a..5094ae24 100644 --- a/dialogs.cpp +++ b/dialogs.cpp @@ -997,12 +997,16 @@ EX namespace dialog { EX void handle_actions(int &sym, int &uni) { if(key_actions.count(uni)) { key_actions[uni](); + #if CAP_SDL if(uni >= ' ' && uni <= 127) ignore_textinput = true; + #endif sym = uni = 0; return; } if(key_actions.count(sym)) { + #if CAP_SDL if(sym >= ' ' && sym <= 127) ignore_textinput = true; + #endif key_actions[sym](); sym = uni = 0; return;