mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
move sdl hint (#856)
This commit is contained in:
@@ -121,6 +121,9 @@ async fn main() -> std::io::Result<()> {
|
||||
std::fs::create_dir_all(dirs.cache_dir)?;
|
||||
std::fs::create_dir_all(dirs.data_dir.join("saves"))?;
|
||||
std::fs::create_dir_all(dirs.data_dir.join("states"))?;
|
||||
|
||||
ui::sdl_hints();
|
||||
|
||||
let args = Args::parse();
|
||||
if let Some(game) = args.game {
|
||||
let file_path = std::path::Path::new(&game);
|
||||
|
||||
@@ -83,6 +83,16 @@ pub struct Ui {
|
||||
pub usb: Usb,
|
||||
}
|
||||
|
||||
pub fn sdl_hints() {
|
||||
unsafe {
|
||||
let hint = std::ffi::CString::new("1").unwrap();
|
||||
sdl3_sys::everything::SDL_SetHint(
|
||||
sdl3_sys::everything::SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS,
|
||||
hint.as_ptr(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn sdl_init(flag: sdl3_sys::init::SDL_InitFlags) {
|
||||
unsafe {
|
||||
if sdl3_sys::init::SDL_WasInit(flag) == 0 && !sdl3_sys::init::SDL_InitSubSystem(flag) {
|
||||
|
||||
@@ -97,11 +97,6 @@ pub fn init(device: &mut device::Device) {
|
||||
}
|
||||
unsafe {
|
||||
sdl3_sys::everything::SDL_HideCursor();
|
||||
let hint = std::ffi::CString::new("1").unwrap();
|
||||
sdl3_sys::everything::SDL_SetHint(
|
||||
sdl3_sys::everything::SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS,
|
||||
hint.as_ptr(),
|
||||
);
|
||||
}
|
||||
|
||||
let gfx_info = build_gfx_info(device);
|
||||
|
||||
Reference in New Issue
Block a user