diff --git a/sdl2-sys/SDL b/sdl2-sys/SDL index 07d0f51fa2..7b11fff2ee 160000 --- a/sdl2-sys/SDL +++ b/sdl2-sys/SDL @@ -1 +1 @@ -Subproject commit 07d0f51fa292895443f563f0cbde4cb3802d87fa +Subproject commit 7b11fff2ee24af7bc815f1d741fab3f5307a9c88 diff --git a/sdl2-sys/sdl_bindings.rs b/sdl2-sys/sdl_bindings.rs index c04ce6e54c..138ae9dca0 100644 --- a/sdl2-sys/sdl_bindings.rs +++ b/sdl2-sys/sdl_bindings.rs @@ -1,8 +1,5 @@ /* automatically generated by rust-bindgen 0.69.4 */ -#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)] -#[repr(transparent)] -pub struct __BindgenFloat16(pub u16); pub const __LINUX__: u32 = 1; pub const HAVE_STDARG_H: u32 = 1; pub const HAVE_STDDEF_H: u32 = 1; @@ -18,6 +15,7 @@ pub const SDL_THREADS_DISABLED: u32 = 1; pub const SDL_TIMERS_DISABLED: u32 = 1; pub const SDL_VIDEO_DRIVER_DUMMY: u32 = 1; pub const SDL_FILESYSTEM_DUMMY: u32 = 1; +pub const __GNUC_VA_LIST: u32 = 1; pub const _STDINT_H: u32 = 1; pub const _FEATURES_H: u32 = 1; pub const _DEFAULT_SOURCE: u32 = 1; @@ -44,7 +42,6 @@ pub const __USE_ATFILE: u32 = 1; pub const __USE_FORTIFY_LEVEL: u32 = 0; pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; -pub const __GLIBC_USE_C2X_STRTOL: u32 = 0; pub const _STDC_PREDEF_H: u32 = 1; pub const __STDC_IEC_559__: u32 = 1; pub const __STDC_IEC_60559_BFP__: u32 = 201404; @@ -53,7 +50,7 @@ pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404; pub const __STDC_ISO_10646__: u32 = 201706; pub const __GNU_LIBRARY__: u32 = 6; pub const __GLIBC__: u32 = 2; -pub const __GLIBC_MINOR__: u32 = 39; +pub const __GLIBC_MINOR__: u32 = 35; pub const _SYS_CDEFS_H: u32 = 1; pub const __glibc_c99_flexarr_available: u32 = 1; pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0; @@ -77,7 +74,6 @@ pub const _BITS_TIME64_H: u32 = 1; pub const _BITS_WCHAR_H: u32 = 1; pub const _BITS_STDINT_INTN_H: u32 = 1; pub const _BITS_STDINT_UINTN_H: u32 = 1; -pub const _BITS_STDINT_LEAST_H: u32 = 1; pub const INT8_MIN: i32 = -128; pub const INT16_MIN: i32 = -32768; pub const INT32_MIN: i32 = -2147483648; @@ -361,6 +357,7 @@ pub const SDL_HINT_BMP_SAVE_LEGACY_FORMAT: &[u8; 27] = b"SDL_BMP_SAVE_LEGACY_FOR pub const SDL_HINT_DISPLAY_USABLE_BOUNDS: &[u8; 26] = b"SDL_DISPLAY_USABLE_BOUNDS\0"; pub const SDL_HINT_EMSCRIPTEN_ASYNCIFY: &[u8; 24] = b"SDL_EMSCRIPTEN_ASYNCIFY\0"; pub const SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT: &[u8; 32] = b"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT\0"; +pub const SDL_HINT_ENABLE_SCREEN_KEYBOARD: &[u8; 27] = b"SDL_ENABLE_SCREEN_KEYBOARD\0"; pub const SDL_HINT_ENABLE_STEAM_CONTROLLERS: &[u8; 29] = b"SDL_ENABLE_STEAM_CONTROLLERS\0"; pub const SDL_HINT_EVENT_LOGGING: &[u8; 18] = b"SDL_EVENT_LOGGING\0"; pub const SDL_HINT_FORCE_RAISEWINDOW: &[u8; 27] = b"SDL_HINT_FORCE_RAISEWINDOW\0"; @@ -383,6 +380,18 @@ pub const SDL_HINT_IME_SUPPORT_EXTENDED_TEXT: &[u8; 30] = b"SDL_IME_SUPPORT_EXTE pub const SDL_HINT_IOS_HIDE_HOME_INDICATOR: &[u8; 28] = b"SDL_IOS_HIDE_HOME_INDICATOR\0"; pub const SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS: &[u8; 37] = b"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS\0"; +pub const SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES: &[u8; 33] = b"SDL_JOYSTICK_ARCADESTICK_DEVICES\0"; +pub const SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED: &[u8; 42] = + b"SDL_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED\0"; +pub const SDL_HINT_JOYSTICK_BLACKLIST_DEVICES: &[u8; 31] = b"SDL_JOYSTICK_BLACKLIST_DEVICES\0"; +pub const SDL_HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED: &[u8; 40] = + b"SDL_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED\0"; +pub const SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES: &[u8; 33] = b"SDL_JOYSTICK_FLIGHTSTICK_DEVICES\0"; +pub const SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED: &[u8; 42] = + b"SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED\0"; +pub const SDL_HINT_JOYSTICK_GAMECUBE_DEVICES: &[u8; 30] = b"SDL_JOYSTICK_GAMECUBE_DEVICES\0"; +pub const SDL_HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED: &[u8; 39] = + b"SDL_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED\0"; pub const SDL_HINT_JOYSTICK_HIDAPI: &[u8; 20] = b"SDL_JOYSTICK_HIDAPI\0"; pub const SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE: &[u8; 29] = b"SDL_JOYSTICK_HIDAPI_GAMECUBE\0"; pub const SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE: &[u8; 35] = @@ -405,6 +414,7 @@ pub const SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED: &[u8; 35] = pub const SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE: &[u8; 31] = b"SDL_JOYSTICK_HIDAPI_PS5_RUMBLE\0"; pub const SDL_HINT_JOYSTICK_HIDAPI_STADIA: &[u8; 27] = b"SDL_JOYSTICK_HIDAPI_STADIA\0"; pub const SDL_HINT_JOYSTICK_HIDAPI_STEAM: &[u8; 26] = b"SDL_JOYSTICK_HIDAPI_STEAM\0"; +pub const SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK: &[u8; 30] = b"SDL_JOYSTICK_HIDAPI_STEAMDECK\0"; pub const SDL_HINT_JOYSTICK_HIDAPI_SWITCH: &[u8; 27] = b"SDL_JOYSTICK_HIDAPI_SWITCH\0"; pub const SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED: &[u8; 36] = b"SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED\0"; @@ -424,17 +434,29 @@ pub const SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS: &[u8; 38] = pub const SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE: &[u8; 29] = b"SDL_JOYSTICK_HIDAPI_XBOX_ONE\0"; pub const SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED: &[u8; 38] = b"SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED\0"; +pub const SDL_HINT_JOYSTICK_IOKIT: &[u8; 19] = b"SDL_JOYSTICK_IOKIT\0"; +pub const SDL_HINT_JOYSTICK_MFI: &[u8; 17] = b"SDL_JOYSTICK_MFI\0"; pub const SDL_HINT_JOYSTICK_RAWINPUT: &[u8; 22] = b"SDL_JOYSTICK_RAWINPUT\0"; pub const SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT: &[u8; 39] = b"SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT\0"; pub const SDL_HINT_JOYSTICK_ROG_CHAKRAM: &[u8; 25] = b"SDL_JOYSTICK_ROG_CHAKRAM\0"; pub const SDL_HINT_JOYSTICK_THREAD: &[u8; 20] = b"SDL_JOYSTICK_THREAD\0"; +pub const SDL_HINT_JOYSTICK_THROTTLE_DEVICES: &[u8; 30] = b"SDL_JOYSTICK_THROTTLE_DEVICES\0"; +pub const SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED: &[u8; 39] = + b"SDL_JOYSTICK_THROTTLE_DEVICES_EXCLUDED\0"; +pub const SDL_HINT_JOYSTICK_WGI: &[u8; 17] = b"SDL_JOYSTICK_WGI\0"; +pub const SDL_HINT_JOYSTICK_WHEEL_DEVICES: &[u8; 27] = b"SDL_JOYSTICK_WHEEL_DEVICES\0"; +pub const SDL_HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED: &[u8; 36] = + b"SDL_JOYSTICK_WHEEL_DEVICES_EXCLUDED\0"; +pub const SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES: &[u8; 35] = + b"SDL_JOYSTICK_ZERO_CENTERED_DEVICES\0"; pub const SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER: &[u8; 30] = b"SDL_KMSDRM_REQUIRE_DRM_MASTER\0"; pub const SDL_HINT_JOYSTICK_DEVICE: &[u8; 20] = b"SDL_JOYSTICK_DEVICE\0"; pub const SDL_HINT_LINUX_DIGITAL_HATS: &[u8; 23] = b"SDL_LINUX_DIGITAL_HATS\0"; pub const SDL_HINT_LINUX_HAT_DEADZONES: &[u8; 24] = b"SDL_LINUX_HAT_DEADZONES\0"; pub const SDL_HINT_LINUX_JOYSTICK_CLASSIC: &[u8; 27] = b"SDL_LINUX_JOYSTICK_CLASSIC\0"; pub const SDL_HINT_LINUX_JOYSTICK_DEADZONES: &[u8; 29] = b"SDL_LINUX_JOYSTICK_DEADZONES\0"; +pub const SDL_HINT_LOGGING: &[u8; 12] = b"SDL_LOGGING\0"; pub const SDL_HINT_MAC_BACKGROUND_APP: &[u8; 23] = b"SDL_MAC_BACKGROUND_APP\0"; pub const SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK: &[u8; 39] = b"SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK\0"; @@ -449,6 +471,8 @@ pub const SDL_HINT_MOUSE_RELATIVE_SCALING: &[u8; 27] = b"SDL_MOUSE_RELATIVE_SCAL pub const SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE: &[u8; 31] = b"SDL_MOUSE_RELATIVE_SPEED_SCALE\0"; pub const SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE: &[u8; 32] = b"SDL_MOUSE_RELATIVE_SYSTEM_SCALE\0"; pub const SDL_HINT_MOUSE_RELATIVE_WARP_MOTION: &[u8; 31] = b"SDL_MOUSE_RELATIVE_WARP_MOTION\0"; +pub const SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE: &[u8; 34] = + b"SDL_MOUSE_RELATIVE_CURSOR_VISIBLE\0"; pub const SDL_HINT_MOUSE_TOUCH_EVENTS: &[u8; 23] = b"SDL_MOUSE_TOUCH_EVENTS\0"; pub const SDL_HINT_MOUSE_AUTO_CAPTURE: &[u8; 23] = b"SDL_MOUSE_AUTO_CAPTURE\0"; pub const SDL_HINT_NO_SIGNAL_HANDLERS: &[u8; 23] = b"SDL_NO_SIGNAL_HANDLERS\0"; @@ -468,6 +492,10 @@ pub const SDL_HINT_RENDER_LOGICAL_SIZE_MODE: &[u8; 29] = b"SDL_RENDER_LOGICAL_SI pub const SDL_HINT_RENDER_OPENGL_SHADERS: &[u8; 26] = b"SDL_RENDER_OPENGL_SHADERS\0"; pub const SDL_HINT_RENDER_SCALE_QUALITY: &[u8; 25] = b"SDL_RENDER_SCALE_QUALITY\0"; pub const SDL_HINT_RENDER_VSYNC: &[u8; 17] = b"SDL_RENDER_VSYNC\0"; +pub const SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE: &[u8; 41] = + b"SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE\0"; +pub const SDL_HINT_ROG_GAMEPAD_MICE: &[u8; 21] = b"SDL_ROG_GAMEPAD_MICE\0"; +pub const SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED: &[u8; 30] = b"SDL_ROG_GAMEPAD_MICE_EXCLUDED\0"; pub const SDL_HINT_PS2_DYNAMIC_VSYNC: &[u8; 22] = b"SDL_PS2_DYNAMIC_VSYNC\0"; pub const SDL_HINT_RETURN_KEY_HIDES_IME: &[u8; 25] = b"SDL_RETURN_KEY_HIDES_IME\0"; pub const SDL_HINT_RPI_VIDEO_LAYER: &[u8; 20] = b"SDL_RPI_VIDEO_LAYER\0"; @@ -512,6 +540,8 @@ pub const SDL_HINT_WAVE_RIFF_CHUNK_SIZE: &[u8; 25] = b"SDL_WAVE_RIFF_CHUNK_SIZE\ pub const SDL_HINT_WAVE_TRUNCATION: &[u8; 20] = b"SDL_WAVE_TRUNCATION\0"; pub const SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING: &[u8; 34] = b"SDL_WINDOWS_DISABLE_THREAD_NAMING\0"; +pub const SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS: &[u8; 34] = + b"SDL_WINDOWS_ENABLE_MENU_MNEMONICS\0"; pub const SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP: &[u8; 31] = b"SDL_WINDOWS_ENABLE_MESSAGELOOP\0"; pub const SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS: &[u8; 42] = b"SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS\0"; @@ -543,13 +573,14 @@ pub const SDL_HINT_VIDEODRIVER: &[u8; 16] = b"SDL_VIDEODRIVER\0"; pub const SDL_HINT_AUDIODRIVER: &[u8; 16] = b"SDL_AUDIODRIVER\0"; pub const SDL_HINT_KMSDRM_DEVICE_INDEX: &[u8; 24] = b"SDL_KMSDRM_DEVICE_INDEX\0"; pub const SDL_HINT_TRACKPAD_IS_TOUCH_ONLY: &[u8; 27] = b"SDL_TRACKPAD_IS_TOUCH_ONLY\0"; +pub const SDL_HINT_SHUTDOWN_DBUS_ON_QUIT: &[u8; 26] = b"SDL_SHUTDOWN_DBUS_ON_QUIT\0"; pub const SDL_MAX_LOG_MESSAGE: u32 = 4096; pub const SDL_NONSHAPEABLE_WINDOW: i32 = -1; pub const SDL_INVALID_SHAPE_ARGUMENT: i32 = -2; pub const SDL_WINDOW_LACKS_SHAPE: i32 = -3; pub const SDL_MAJOR_VERSION: u32 = 2; -pub const SDL_MINOR_VERSION: u32 = 26; -pub const SDL_PATCHLEVEL: u32 = 4; +pub const SDL_MINOR_VERSION: u32 = 30; +pub const SDL_PATCHLEVEL: u32 = 5; pub const SDL_INIT_TIMER: u32 = 1; pub const SDL_INIT_AUDIO: u32 = 16; pub const SDL_INIT_VIDEO: u32 = 32; @@ -1061,8 +1092,8 @@ fn bindgen_test_layout_max_align_t() { ) ); } -pub type __gnuc_va_list = __builtin_va_list; pub type va_list = __builtin_va_list; +pub type __gnuc_va_list = __builtin_va_list; pub type __u_char = libc::c_uchar; pub type __u_short = libc::c_ushort; pub type __u_int = libc::c_uint; @@ -1725,7 +1756,7 @@ extern "C" { ) -> usize; } extern "C" { - #[doc = " This function converts a string between encodings in one pass, returning a\n string that must be freed with SDL_free() or NULL on error.\n\n \\since This function is available since SDL 2.0.0."] + #[doc = " This function converts a buffer or string between encodings in one pass,\n returning a string that must be freed with SDL_free() or NULL on error.\n\n \\since This function is available since SDL 2.0.0."] pub fn SDL_iconv_string( tocode: *const libc::c_char, fromcode: *const libc::c_char, @@ -2053,8 +2084,8 @@ extern "C" { pub fn SDL_SemTryWait(sem: *mut SDL_sem) -> libc::c_int; } extern "C" { - #[doc = " Wait until a semaphore has a positive value and then decrements it.\n\n This function suspends the calling thread until either the semaphore\n pointed to by `sem` has a positive value, the call is interrupted by a\n signal or error, or the specified time has elapsed. If the call is\n successful it will atomically decrement the semaphore value.\n\n \\param sem the semaphore to wait on\n \\param ms the length of the timeout, in milliseconds\n \\returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not\n succeed in the allotted time, or a negative error code on failure;\n call SDL_GetError() for more information.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_CreateSemaphore\n \\sa SDL_DestroySemaphore\n \\sa SDL_SemPost\n \\sa SDL_SemTryWait\n \\sa SDL_SemValue\n \\sa SDL_SemWait"] - pub fn SDL_SemWaitTimeout(sem: *mut SDL_sem, ms: Uint32) -> libc::c_int; + #[doc = " Wait until a semaphore has a positive value and then decrements it.\n\n This function suspends the calling thread until either the semaphore\n pointed to by `sem` has a positive value, the call is interrupted by a\n signal or error, or the specified time has elapsed. If the call is\n successful it will atomically decrement the semaphore value.\n\n \\param sem the semaphore to wait on\n \\param timeout the length of the timeout, in milliseconds\n \\returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not\n succeed in the allotted time, or a negative error code on failure;\n call SDL_GetError() for more information.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_CreateSemaphore\n \\sa SDL_DestroySemaphore\n \\sa SDL_SemPost\n \\sa SDL_SemTryWait\n \\sa SDL_SemValue\n \\sa SDL_SemWait"] + pub fn SDL_SemWaitTimeout(sem: *mut SDL_sem, timeout: Uint32) -> libc::c_int; } extern "C" { #[doc = " Atomically increment a semaphore's value and wake waiting threads.\n\n \\param sem the semaphore to increment\n \\returns 0 on success or a negative error code on failure; call\n SDL_GetError() for more information.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_CreateSemaphore\n \\sa SDL_DestroySemaphore\n \\sa SDL_SemTryWait\n \\sa SDL_SemValue\n \\sa SDL_SemWait\n \\sa SDL_SemWaitTimeout"] @@ -2580,7 +2611,7 @@ pub type SDL_AudioFormat = Uint16; pub type SDL_AudioCallback = ::core::option::Option< unsafe extern "C" fn(userdata: *mut libc::c_void, stream: *mut Uint8, len: libc::c_int), >; -#[doc = " The calculated values in this structure are calculated by SDL_OpenAudio().\n\n For multi-channel audio, the default SDL channel mapping is:\n 2: FL FR (stereo)\n 3: FL FR LFE (2.1 surround)\n 4: FL FR BL BR (quad)\n 5: FL FR LFE BL BR (4.1 surround)\n 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)\n 7: FL FR FC LFE BC SL SR (6.1 surround)\n 8: FL FR FC LFE BL BR SL SR (7.1 surround)"] +#[doc = " The calculated values in this structure are calculated by SDL_OpenAudio().\n\n For multi-channel audio, the default SDL channel mapping is:\n 2: FL FR (stereo)\n 3: FL FR LFE (2.1 surround)\n 4: FL FR BL BR (quad)\n 5: FL FR LFE BL BR (4.1 surround)\n 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)\n 7: FL FR FC LFE BC SL SR (6.1 surround)\n 8: FL FR FC LFE BL BR SL SR (7.1 surround)"] #[repr(C)] #[derive(Copy, Clone)] pub struct SDL_AudioSpec { @@ -4755,15 +4786,6 @@ extern "C" { extern "C" { pub fn lcong48_r(__param: *mut libc::c_ushort, __buffer: *mut drand48_data) -> libc::c_int; } -extern "C" { - pub fn arc4random() -> __uint32_t; -} -extern "C" { - pub fn arc4random_buf(__buf: *mut libc::c_void, __size: usize); -} -extern "C" { - pub fn arc4random_uniform(__upper_bound: __uint32_t) -> __uint32_t; -} extern "C" { pub fn malloc(__size: libc::c_ulong) -> *mut libc::c_void; } @@ -5030,11 +5052,6 @@ pub type __v2du = [libc::c_ulonglong; 2usize]; pub type __v8hu = [libc::c_ushort; 8usize]; pub type __v16qu = [libc::c_uchar; 16usize]; pub type __v16qs = [libc::c_schar; 16usize]; -pub type __v8hf = [__BindgenFloat16; 8usize]; -pub type __m128h = [__BindgenFloat16; 8usize]; -pub type __m128h_u = [__BindgenFloat16; 8usize]; -pub type __v8bf = u128; -pub type __m128bh = u128; extern "C" { pub fn _mm_clflush(__p: *const libc::c_void); } @@ -5155,6 +5172,7 @@ pub enum SDL_PixelType { SDL_PIXELTYPE_ARRAYU32 = 9, SDL_PIXELTYPE_ARRAYF16 = 10, SDL_PIXELTYPE_ARRAYF32 = 11, + SDL_PIXELTYPE_INDEX2 = 12, } #[repr(u32)] #[doc = " Bitmap pixel order, high bit -> low bit."] @@ -5244,12 +5262,30 @@ impl SDL_PixelFormatEnum { pub const SDL_PIXELFORMAT_ABGR32: SDL_PixelFormatEnum = SDL_PixelFormatEnum::SDL_PIXELFORMAT_RGBA8888; } +impl SDL_PixelFormatEnum { + pub const SDL_PIXELFORMAT_RGBX32: SDL_PixelFormatEnum = + SDL_PixelFormatEnum::SDL_PIXELFORMAT_XBGR8888; +} +impl SDL_PixelFormatEnum { + pub const SDL_PIXELFORMAT_XRGB32: SDL_PixelFormatEnum = + SDL_PixelFormatEnum::SDL_PIXELFORMAT_BGRX8888; +} +impl SDL_PixelFormatEnum { + pub const SDL_PIXELFORMAT_BGRX32: SDL_PixelFormatEnum = + SDL_PixelFormatEnum::SDL_PIXELFORMAT_XRGB8888; +} +impl SDL_PixelFormatEnum { + pub const SDL_PIXELFORMAT_XBGR32: SDL_PixelFormatEnum = + SDL_PixelFormatEnum::SDL_PIXELFORMAT_RGBX8888; +} #[repr(u32)] #[derive(Copy, Clone, Hash, PartialEq, Eq)] pub enum SDL_PixelFormatEnum { SDL_PIXELFORMAT_UNKNOWN = 0, SDL_PIXELFORMAT_INDEX1LSB = 286261504, SDL_PIXELFORMAT_INDEX1MSB = 287310080, + SDL_PIXELFORMAT_INDEX2LSB = 470811136, + SDL_PIXELFORMAT_INDEX2MSB = 471859712, SDL_PIXELFORMAT_INDEX4LSB = 303039488, SDL_PIXELFORMAT_INDEX4MSB = 304088064, SDL_PIXELFORMAT_INDEX8 = 318769153, @@ -6042,7 +6078,7 @@ pub enum SDL_BlendMode { SDL_BLENDMODE_ADD = 2, #[doc = "< color modulate\ndstRGB = srcRGB * dstRGB\ndstA = dstA"] SDL_BLENDMODE_MOD = 4, - #[doc = "< color multiply\ndstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))\ndstA = (srcA * dstA) + (dstA * (1-srcA))"] + #[doc = "< color multiply\ndstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))\ndstA = dstA"] SDL_BLENDMODE_MUL = 8, SDL_BLENDMODE_INVALID = 2147483647, } @@ -6052,9 +6088,9 @@ pub enum SDL_BlendMode { pub enum SDL_BlendOperation { #[doc = "< dst + src: supported by all renderers"] SDL_BLENDOPERATION_ADD = 1, - #[doc = "< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES"] - SDL_BLENDOPERATION_SUBTRACT = 2, #[doc = "< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES"] + SDL_BLENDOPERATION_SUBTRACT = 2, + #[doc = "< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES"] SDL_BLENDOPERATION_REV_SUBTRACT = 3, #[doc = "< min(dst, src) : supported by D3D9, D3D11"] SDL_BLENDOPERATION_MINIMUM = 4, @@ -6760,6 +6796,8 @@ pub enum SDL_DisplayEventID { SDL_DISPLAYEVENT_CONNECTED = 2, #[doc = "< Display has been removed from the system"] SDL_DISPLAYEVENT_DISCONNECTED = 3, + #[doc = "< Display has changed position"] + SDL_DISPLAYEVENT_MOVED = 4, } #[repr(u32)] #[doc = " \\brief Display orientation"] @@ -7131,7 +7169,11 @@ extern "C" { pub fn SDL_SetWindowFullscreen(window: *mut SDL_Window, flags: Uint32) -> libc::c_int; } extern "C" { - #[doc = " Get the SDL surface associated with the window.\n\n A new surface will be created with the optimal format for the window, if\n necessary. This surface will be freed when the window is destroyed. Do not\n free this surface.\n\n This surface will be invalidated if the window is resized. After resizing a\n window this function must be called again to return a valid surface.\n\n You may not combine this with 3D or the rendering API on this window.\n\n This function is affected by `SDL_HINT_FRAMEBUFFER_ACCELERATION`.\n\n \\param window the window to query\n \\returns the surface associated with the window, or NULL on failure; call\n SDL_GetError() for more information.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_UpdateWindowSurface\n \\sa SDL_UpdateWindowSurfaceRects"] + #[doc = " Return whether the window has a surface associated with it.\n\n \\returns SDL_TRUE if there is a surface associated with the window, or\n SDL_FALSE otherwise.\n\n \\since This function is available since SDL 2.28.0.\n\n \\sa SDL_GetWindowSurface"] + pub fn SDL_HasWindowSurface(window: *mut SDL_Window) -> SDL_bool; +} +extern "C" { + #[doc = " Get the SDL surface associated with the window.\n\n A new surface will be created with the optimal format for the window, if\n necessary. This surface will be freed when the window is destroyed. Do not\n free this surface.\n\n This surface will be invalidated if the window is resized. After resizing a\n window this function must be called again to return a valid surface.\n\n You may not combine this with 3D or the rendering API on this window.\n\n This function is affected by `SDL_HINT_FRAMEBUFFER_ACCELERATION`.\n\n \\param window the window to query\n \\returns the surface associated with the window, or NULL on failure; call\n SDL_GetError() for more information.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_DestroyWindowSurface\n \\sa SDL_HasWindowSurface\n \\sa SDL_UpdateWindowSurface\n \\sa SDL_UpdateWindowSurfaceRects"] pub fn SDL_GetWindowSurface(window: *mut SDL_Window) -> *mut SDL_Surface; } extern "C" { @@ -7139,13 +7181,17 @@ extern "C" { pub fn SDL_UpdateWindowSurface(window: *mut SDL_Window) -> libc::c_int; } extern "C" { - #[doc = " Copy areas of the window surface to the screen.\n\n This is the function you use to reflect changes to portions of the surface\n on the screen.\n\n This function is equivalent to the SDL 1.2 API SDL_UpdateRects().\n\n \\param window the window to update\n \\param rects an array of SDL_Rect structures representing areas of the\n surface to copy\n \\param numrects the number of rectangles\n \\returns 0 on success or a negative error code on failure; call\n SDL_GetError() for more information.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_GetWindowSurface\n \\sa SDL_UpdateWindowSurface"] + #[doc = " Copy areas of the window surface to the screen.\n\n This is the function you use to reflect changes to portions of the surface\n on the screen.\n\n This function is equivalent to the SDL 1.2 API SDL_UpdateRects().\n\n Note that this function will update _at least_ the rectangles specified,\n but this is only intended as an optimization; in practice, this might\n update more of the screen (or all of the screen!), depending on what\n method SDL uses to send pixels to the system.\n\n \\param window the window to update\n \\param rects an array of SDL_Rect structures representing areas of the\n surface to copy, in pixels\n \\param numrects the number of rectangles\n \\returns 0 on success or a negative error code on failure; call\n SDL_GetError() for more information.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_GetWindowSurface\n \\sa SDL_UpdateWindowSurface"] pub fn SDL_UpdateWindowSurfaceRects( window: *mut SDL_Window, rects: *const SDL_Rect, numrects: libc::c_int, ) -> libc::c_int; } +extern "C" { + #[doc = " Destroy the surface associated with the window.\n\n \\param window the window to update\n \\returns 0 on success or a negative error code on failure; call\n SDL_GetError() for more information.\n\n \\since This function is available since SDL 2.28.0.\n\n \\sa SDL_GetWindowSurface\n \\sa SDL_HasWindowSurface"] + pub fn SDL_DestroyWindowSurface(window: *mut SDL_Window) -> libc::c_int; +} extern "C" { #[doc = " Set a window's input grab mode.\n\n When input is grabbed, the mouse is confined to the window. This function\n will also grab the keyboard if `SDL_HINT_GRAB_KEYBOARD` is set. To grab the\n keyboard without also grabbing the mouse, use SDL_SetWindowKeyboardGrab().\n\n If the caller enables a grab while another window is currently grabbed, the\n other window loses its grab in favor of the caller's window.\n\n \\param window the window for which the input grab mode should be set\n \\param grabbed SDL_TRUE to grab input or SDL_FALSE to release input\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_GetGrabbedWindow\n \\sa SDL_GetWindowGrab"] pub fn SDL_SetWindowGrab(window: *mut SDL_Window, grabbed: SDL_bool); @@ -7652,7 +7698,7 @@ pub enum SDL_Scancode { #[doc = "< not a key, just marks the number of scancodes\nfor array bounds"] SDL_NUM_SCANCODES = 512, } -#[doc = " \\brief The SDL virtual key representation.\n\n Values of this type are used to represent keyboard keys using the current\n layout of the keyboard. These values include Unicode values representing\n the unmodified character that would be generated by pressing the key, or\n an SDLK_* constant for those keys that do not generate characters.\n\n A special exception is the number keys at the top of the keyboard which\n always map to SDLK_0...SDLK_9, regardless of layout."] +#[doc = " \\brief The SDL virtual key representation.\n\n Values of this type are used to represent keyboard keys using the current\n layout of the keyboard. These values include Unicode values representing\n the unmodified character that would be generated by pressing the key, or\n an SDLK_* constant for those keys that do not generate characters.\n\n A special exception is the number keys at the top of the keyboard which\n map to SDLK_0...SDLK_9 on AZERTY layouts."] pub type SDL_Keycode = Sint32; #[repr(u32)] #[derive(Copy, Clone, Hash, PartialEq, Eq)] @@ -8059,7 +8105,7 @@ extern "C" { pub fn SDL_IsTextInputShown() -> SDL_bool; } extern "C" { - #[doc = " Set the rectangle used to type Unicode text inputs.\n\n To start text input in a given location, this function is intended to be\n called before SDL_StartTextInput, although some platforms support moving\n the rectangle even while text input (and a composition) is active.\n\n Note: If you want to use the system native IME window, try setting hint\n **SDL_HINT_IME_SHOW_UI** to **1**, otherwise this function won't give you\n any feedback.\n\n \\param rect the SDL_Rect structure representing the rectangle to receive\n text (ignored if NULL)\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_StartTextInput"] + #[doc = " Set the rectangle used to type Unicode text inputs. Native input methods\n will place a window with word suggestions near it, without covering the\n text being inputted.\n\n To start text input in a given location, this function is intended to be\n called before SDL_StartTextInput, although some platforms support moving\n the rectangle even while text input (and a composition) is active.\n\n Note: If you want to use the system native IME window, try setting hint\n **SDL_HINT_IME_SHOW_UI** to **1**, otherwise this function won't give you\n any feedback.\n\n \\param rect the SDL_Rect structure representing the rectangle to receive\n text (ignored if NULL)\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_StartTextInput"] pub fn SDL_SetTextInputRect(rect: *const SDL_Rect); } extern "C" { @@ -8139,7 +8185,7 @@ extern "C" { pub fn SDL_WarpMouseGlobal(x: libc::c_int, y: libc::c_int) -> libc::c_int; } extern "C" { - #[doc = " Set relative mouse mode.\n\n While the mouse is in relative mode, the cursor is hidden, and the driver\n will try to report continuous motion in the current window. Only relative\n motion events will be delivered, the mouse position will not change.\n\n Note that this function will not be able to provide continuous relative\n motion when used over Microsoft Remote Desktop, instead motion is limited\n to the bounds of the screen.\n\n This function will flush any pending mouse motion.\n\n \\param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable.\n \\returns 0 on success or a negative error code on failure; call\n SDL_GetError() for more information.\n\n If relative mode is not supported, this returns -1.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_GetRelativeMouseMode"] + #[doc = " Set relative mouse mode.\n\n While the mouse is in relative mode, the cursor is hidden, the mouse\n position is constrained to the window, and SDL will report continuous\n relative mouse motion even if the mouse is at the edge of the window.\n\n This function will flush any pending mouse motion.\n\n \\param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable.\n \\returns 0 on success or a negative error code on failure; call\n SDL_GetError() for more information.\n\n If relative mode is not supported, this returns -1.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_GetRelativeMouseMode"] pub fn SDL_SetRelativeMouseMode(enabled: SDL_bool) -> libc::c_int; } extern "C" { @@ -8182,7 +8228,7 @@ extern "C" { pub fn SDL_GetCursor() -> *mut SDL_Cursor; } extern "C" { - #[doc = " Get the default cursor.\n\n \\returns the default cursor on success or NULL on failure.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_CreateSystemCursor"] + #[doc = " Get the default cursor.\n\n You do not have to call SDL_FreeCursor() on the return value, but it is\n safe to do so.\n\n \\returns the default cursor on success or NULL on failure.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_CreateSystemCursor"] pub fn SDL_GetDefaultCursor() -> *mut SDL_Cursor; } extern "C" { @@ -8232,7 +8278,6 @@ extern "C" { #[doc = " Convert a GUID string into a ::SDL_GUID structure.\n\n Performs no error checking. If this function is given a string containing\n an invalid GUID, the function will silently succeed, but the GUID generated\n will not be useful.\n\n \\param pchGUID string containing an ASCII representation of a GUID\n \\returns a ::SDL_GUID structure.\n\n \\since This function is available since SDL 2.24.0.\n\n \\sa SDL_GUIDToString"] pub fn SDL_GUIDFromString(pchGUID: *const libc::c_char) -> SDL_GUID; } -#[doc = " The joystick structure used to identify an SDL joystick"] #[repr(C)] #[derive(Copy, Clone)] pub struct _SDL_Joystick { @@ -8313,7 +8358,7 @@ extern "C" { pub fn SDL_JoystickGetDeviceType(device_index: libc::c_int) -> SDL_JoystickType; } extern "C" { - #[doc = " Get the instance ID of a joystick.\n\n This can be called before any joysticks are opened. If the index is out of\n range, this function will return -1.\n\n \\param device_index the index of the joystick to query (the N'th joystick\n on the system\n \\returns the instance id of the selected joystick. If called on an invalid\n index, this function returns zero\n\n \\since This function is available since SDL 2.0.6."] + #[doc = " Get the instance ID of a joystick.\n\n This can be called before any joysticks are opened.\n\n \\param device_index the index of the joystick to query (the N'th joystick\n on the system\n \\returns the instance id of the selected joystick. If called on an invalid\n index, this function returns -1.\n\n \\since This function is available since SDL 2.0.6."] pub fn SDL_JoystickGetDeviceInstanceID(device_index: libc::c_int) -> SDL_JoystickID; } extern "C" { @@ -8732,7 +8777,7 @@ extern "C" { pub fn SDL_JoystickUpdate(); } extern "C" { - #[doc = " Enable/disable joystick event polling.\n\n If joystick events are disabled, you must call SDL_JoystickUpdate()\n yourself and manually check the state of the joystick when you want\n joystick information.\n\n It is recommended that you leave joystick event handling enabled.\n\n **WARNING**: Calling this function may delete all events currently in SDL's\n event queue.\n\n \\param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`\n \\returns 1 if enabled, 0 if disabled, or a negative error code on failure;\n call SDL_GetError() for more information.\n\n If `state` is `SDL_QUERY` then the current state is returned,\n otherwise the new processing state is returned.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_GameControllerEventState"] + #[doc = " Enable/disable joystick event polling.\n\n If joystick events are disabled, you must call SDL_JoystickUpdate()\n yourself and manually check the state of the joystick when you want\n joystick information.\n\n It is recommended that you leave joystick event handling enabled.\n\n **WARNING**: Calling this function may delete all events currently in SDL's\n event queue.\n\n While `param` is meant to be one of `SDL_QUERY`, `SDL_IGNORE`, or\n `SDL_ENABLE`, this function accepts any value, with any non-zero value that\n isn't `SDL_QUERY` being treated as `SDL_ENABLE`.\n\n If SDL was built with events disabled (extremely uncommon!), this will\n do nothing and always return `SDL_IGNORE`.\n\n \\param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`\n \\returns If `state` is `SDL_QUERY` then the current state is returned,\n otherwise `state` is returned (even if it was not one of the\n allowed values).\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_GameControllerEventState"] pub fn SDL_JoystickEventState(state: libc::c_int) -> libc::c_int; } extern "C" { @@ -8948,6 +8993,7 @@ pub enum SDL_GameControllerType { SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT = 11, SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT = 12, SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR = 13, + SDL_CONTROLLER_TYPE_MAX = 14, } #[repr(u32)] #[derive(Copy, Clone, Hash, PartialEq, Eq)] @@ -9217,6 +9263,10 @@ extern "C" { gamecontroller: *mut SDL_GameController, ) -> *const libc::c_char; } +extern "C" { + #[doc = " Get the Steam Input handle of an opened controller, if available.\n\n Returns an InputHandle_t for the controller that can be used with Steam Input API:\n https://partner.steamgames.com/doc/api/ISteamInput\n\n \\param gamecontroller the game controller object to query.\n \\returns the gamepad handle, or 0 if unavailable.\n\n \\since This function is available since SDL 2.30.0."] + pub fn SDL_GameControllerGetSteamHandle(gamecontroller: *mut SDL_GameController) -> Uint64; +} extern "C" { #[doc = " Check if a controller has been opened and is currently connected.\n\n \\param gamecontroller a game controller identifier previously returned by\n SDL_GameControllerOpen()\n \\returns SDL_TRUE if the controller has been opened and is currently\n connected, or SDL_FALSE if not.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_GameControllerClose\n \\sa SDL_GameControllerOpen"] pub fn SDL_GameControllerGetAttached(gamecontroller: *mut SDL_GameController) -> SDL_bool; @@ -9236,7 +9286,7 @@ extern "C" { pub fn SDL_GameControllerUpdate(); } #[repr(i32)] -#[doc = " The list of axes available from a controller\n\n Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX,\n and are centered within ~8000 of zero, though advanced UI will allow users to set\n or autodetect the dead zone, which varies between controllers.\n\n Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX."] +#[doc = " The list of axes available from a controller\n\n Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX,\n and are centered within ~8000 of zero, though advanced UI will allow users to set\n or autodetect the dead zone, which varies between controllers.\n\n Trigger axis values range from 0 (released) to SDL_JOYSTICK_AXIS_MAX\n (fully pressed) when reported by SDL_GameControllerGetAxis(). Note that this is not the\n same range that will be reported by the lower-level SDL_GetJoystickAxis()."] #[derive(Copy, Clone, Hash, PartialEq, Eq)] pub enum SDL_GameControllerAxis { SDL_CONTROLLER_AXIS_INVALID = -1, @@ -9272,7 +9322,7 @@ extern "C" { ) -> SDL_bool; } extern "C" { - #[doc = " Get the current state of an axis control on a game controller.\n\n The axis indices start at index 0.\n\n The state is a value ranging from -32768 to 32767. Triggers, however, range\n from 0 to 32767 (they never return a negative value).\n\n \\param gamecontroller a game controller\n \\param axis an axis index (one of the SDL_GameControllerAxis values)\n \\returns axis state (including 0) on success or 0 (also) on failure; call\n SDL_GetError() for more information.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_GameControllerGetButton"] + #[doc = " Get the current state of an axis control on a game controller.\n\n The axis indices start at index 0.\n\n For thumbsticks, the state is a value ranging from -32768 (up/left)\n to 32767 (down/right).\n\n Triggers range from 0 when released to 32767 when fully pressed, and\n never return a negative value. Note that this differs from the value\n reported by the lower-level SDL_GetJoystickAxis(), which normally uses\n the full range.\n\n \\param gamecontroller a game controller\n \\param axis an axis index (one of the SDL_GameControllerAxis values)\n \\returns axis state (including 0) on success or 0 (also) on failure; call\n SDL_GetError() for more information.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_GameControllerGetButton"] pub fn SDL_GameControllerGetAxis( gamecontroller: *mut SDL_GameController, axis: SDL_GameControllerAxis, @@ -9676,6 +9726,9 @@ pub enum SDL_EventType { SDL_CONTROLLERTOUCHPADUP = 1624, #[doc = "< Game controller sensor was updated"] SDL_CONTROLLERSENSORUPDATE = 1625, + SDL_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3 = 1626, + #[doc = "< Game controller Steam handle has changed"] + SDL_CONTROLLERSTEAMHANDLEUPDATED = 1627, SDL_FINGERDOWN = 1792, SDL_FINGERUP = 1793, SDL_FINGERMOTION = 1794, @@ -11590,7 +11643,7 @@ fn bindgen_test_layout_SDL_ControllerButtonEvent() { #[repr(C)] #[derive(Copy, Clone)] pub struct SDL_ControllerDeviceEvent { - #[doc = "< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED"] + #[doc = "< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, ::SDL_CONTROLLERDEVICEREMAPPED, or ::SDL_CONTROLLERSTEAMHANDLEUPDATED"] pub type_: Uint32, #[doc = "< In milliseconds, populated using SDL_GetTicks()"] pub timestamp: Uint32, @@ -12524,50 +12577,6 @@ fn bindgen_test_layout_SDL_QuitEvent() { ) ); } -#[doc = " \\brief OS Specific event"] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct SDL_OSEvent { - #[doc = "< ::SDL_QUIT"] - pub type_: Uint32, - #[doc = "< In milliseconds, populated using SDL_GetTicks()"] - pub timestamp: Uint32, -} -#[test] -fn bindgen_test_layout_SDL_OSEvent() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(SDL_OSEvent)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(SDL_OSEvent)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(SDL_OSEvent), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).timestamp) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(SDL_OSEvent), - "::", - stringify!(timestamp) - ) - ); -} #[doc = " \\brief A user-defined event type (event.user.*)"] #[repr(C)] #[derive(Copy, Clone)] @@ -13208,11 +13217,11 @@ extern "C" { pub fn SDL_RegisterEvents(numevents: libc::c_int) -> Uint32; } extern "C" { - #[doc = " Get the directory where the application was run from.\n\n This is not necessarily a fast call, so you should call this once near\n startup and save the string if you need it.\n\n **Mac OS X and iOS Specific Functionality**: If the application is in a\n \".app\" bundle, this function returns the Resource directory (e.g.\n MyApp.app/Contents/Resources/). This behaviour can be overridden by adding\n a property to the Info.plist file. Adding a string key with the name\n SDL_FILESYSTEM_BASE_DIR_TYPE with a supported value will change the\n behaviour.\n\n Supported values for the SDL_FILESYSTEM_BASE_DIR_TYPE property (Given an\n application in /Applications/SDLApp/MyApp.app):\n\n - `resource`: bundle resource directory (the default). For example:\n `/Applications/SDLApp/MyApp.app/Contents/Resources`\n - `bundle`: the Bundle directory. For example:\n `/Applications/SDLApp/MyApp.app/`\n - `parent`: the containing directory of the bundle. For example:\n `/Applications/SDLApp/`\n\n **Nintendo 3DS Specific Functionality**: This function returns \"romfs\"\n directory of the application as it is uncommon to store resources outside\n the executable. As such it is not a writable directory.\n\n The returned path is guaranteed to end with a path separator ('\\' on\n Windows, '/' on most other platforms).\n\n The pointer returned is owned by the caller. Please call SDL_free() on the\n pointer when done with it.\n\n \\returns an absolute path in UTF-8 encoding to the application data\n directory. NULL will be returned on error or when the platform\n doesn't implement this functionality, call SDL_GetError() for more\n information.\n\n \\since This function is available since SDL 2.0.1.\n\n \\sa SDL_GetPrefPath"] + #[doc = " Get the directory where the application was run from.\n\n This is not necessarily a fast call, so you should call this once near\n startup and save the string if you need it.\n\n **Mac OS X and iOS Specific Functionality**: If the application is in a\n \".app\" bundle, this function returns the Resource directory (e.g.\n MyApp.app/Contents/Resources/). This behaviour can be overridden by adding\n a property to the Info.plist file. Adding a string key with the name\n SDL_FILESYSTEM_BASE_DIR_TYPE with a supported value will change the\n behaviour.\n\n Supported values for the SDL_FILESYSTEM_BASE_DIR_TYPE property (Given an\n application in /Applications/SDLApp/MyApp.app):\n\n - `resource`: bundle resource directory (the default). For example:\n `/Applications/SDLApp/MyApp.app/Contents/Resources`\n - `bundle`: the Bundle directory. For example:\n `/Applications/SDLApp/MyApp.app/`\n - `parent`: the containing directory of the bundle. For example:\n `/Applications/SDLApp/`\n\n **Nintendo 3DS Specific Functionality**: This function returns \"romfs\"\n directory of the application as it is uncommon to store resources outside\n the executable. As such it is not a writable directory.\n\n The returned path is guaranteed to end with a path separator ('\\\\' on\n Windows, '/' on most other platforms).\n\n The pointer returned is owned by the caller. Please call SDL_free() on the\n pointer when done with it.\n\n \\returns an absolute path in UTF-8 encoding to the application data\n directory. NULL will be returned on error or when the platform\n doesn't implement this functionality, call SDL_GetError() for more\n information.\n\n \\since This function is available since SDL 2.0.1.\n\n \\sa SDL_GetPrefPath"] pub fn SDL_GetBasePath() -> *mut libc::c_char; } extern "C" { - #[doc = " Get the user-and-app-specific path where files can be written.\n\n Get the \"pref dir\". This is meant to be where users can write personal\n files (preferences and save games, etc) that are specific to your\n application. This directory is unique per user, per application.\n\n This function will decide the appropriate location in the native\n filesystem, create the directory if necessary, and return a string of the\n absolute path to the directory in UTF-8 encoding.\n\n On Windows, the string might look like:\n\n `C:\\\\Users\\\\bob\\\\AppData\\\\Roaming\\\\My Company\\\\My Program Name\\\\`\n\n On Linux, the string might look like:\n\n `/home/bob/.local/share/My Program Name/`\n\n On Mac OS X, the string might look like:\n\n `/Users/bob/Library/Application Support/My Program Name/`\n\n You should assume the path returned by this function is the only safe place\n to write files (and that SDL_GetBasePath(), while it might be writable, or\n even the parent of the returned path, isn't where you should be writing\n things).\n\n Both the org and app strings may become part of a directory name, so please\n follow these rules:\n\n - Try to use the same org string (_including case-sensitivity_) for all\n your applications that use this function.\n - Always use a unique app string for each one, and make sure it never\n changes for an app once you've decided on it.\n - Unicode characters are legal, as long as it's UTF-8 encoded, but...\n - ...only use letters, numbers, and spaces. Avoid punctuation like \"Game\n Name 2: Bad Guy's Revenge!\" ... \"Game Name 2\" is sufficient.\n\n The returned path is guaranteed to end with a path separator ('\\' on\n Windows, '/' on most other platforms).\n\n The pointer returned is owned by the caller. Please call SDL_free() on the\n pointer when done with it.\n\n \\param org the name of your organization\n \\param app the name of your application\n \\returns a UTF-8 string of the user directory in platform-dependent\n notation. NULL if there's a problem (creating directory failed,\n etc.).\n\n \\since This function is available since SDL 2.0.1.\n\n \\sa SDL_GetBasePath"] + #[doc = " Get the user-and-app-specific path where files can be written.\n\n Get the \"pref dir\". This is meant to be where users can write personal\n files (preferences and save games, etc) that are specific to your\n application. This directory is unique per user, per application.\n\n This function will decide the appropriate location in the native\n filesystem, create the directory if necessary, and return a string of the\n absolute path to the directory in UTF-8 encoding.\n\n On Windows, the string might look like:\n\n `C:\\\\Users\\\\bob\\\\AppData\\\\Roaming\\\\My Company\\\\My Program Name\\\\`\n\n On Linux, the string might look like:\n\n `/home/bob/.local/share/My Program Name/`\n\n On Mac OS X, the string might look like:\n\n `/Users/bob/Library/Application Support/My Program Name/`\n\n You should assume the path returned by this function is the only safe place\n to write files (and that SDL_GetBasePath(), while it might be writable, or\n even the parent of the returned path, isn't where you should be writing\n things).\n\n Both the org and app strings may become part of a directory name, so please\n follow these rules:\n\n - Try to use the same org string (_including case-sensitivity_) for all\n your applications that use this function.\n - Always use a unique app string for each one, and make sure it never\n changes for an app once you've decided on it.\n - Unicode characters are legal, as long as it's UTF-8 encoded, but...\n - ...only use letters, numbers, and spaces. Avoid punctuation like \"Game\n Name 2: Bad Guy's Revenge!\" ... \"Game Name 2\" is sufficient.\n\n The returned path is guaranteed to end with a path separator ('\\\\' on\n Windows, '/' on most other platforms).\n\n The pointer returned is owned by the caller. Please call SDL_free() on the\n pointer when done with it.\n\n \\param org the name of your organization\n \\param app the name of your application\n \\returns a UTF-8 string of the user directory in platform-dependent\n notation. NULL if there's a problem (creating directory failed,\n etc.).\n\n \\since This function is available since SDL 2.0.1.\n\n \\sa SDL_GetBasePath"] pub fn SDL_GetPrefPath(org: *const libc::c_char, app: *const libc::c_char) -> *mut libc::c_char; } @@ -14836,7 +14845,7 @@ extern "C" { pub fn SDL_UnloadObject(handle: *mut libc::c_void); } #[repr(u32)] -#[doc = " \\brief The predefined log categories\n\n By default the application category is enabled at the INFO level,\n the assert category is enabled at the WARN level, test is enabled\n at the VERBOSE level and all other categories are enabled at the\n CRITICAL level."] +#[doc = " \\brief The predefined log categories\n\n By default the application category is enabled at the INFO level,\n the assert category is enabled at the WARN level, test is enabled\n at the VERBOSE level and all other categories are enabled at the\n ERROR level."] #[derive(Copy, Clone, Hash, PartialEq, Eq)] pub enum SDL_LogCategory { SDL_LOG_CATEGORY_APPLICATION = 0, @@ -15287,8 +15296,9 @@ pub enum SDL_PowerState { SDL_POWERSTATE_CHARGED = 4, } extern "C" { - #[doc = " Get the current power supply details.\n\n You should never take a battery status as absolute truth. Batteries\n (especially failing batteries) are delicate hardware, and the values\n reported here are best estimates based on what that hardware reports. It's\n not uncommon for older batteries to lose stored power much faster than it\n reports, or completely drain when reporting it has 20 percent left, etc.\n\n Battery status can change at any time; if you are concerned with power\n state, you should call this function frequently, and perhaps ignore changes\n until they seem to be stable for a few seconds.\n\n It's possible a platform can only report battery percentage or time left\n but not both.\n\n \\param secs seconds of battery life left, you can pass a NULL here if you\n don't care, will return -1 if we can't determine a value, or\n we're not running on a battery\n \\param pct percentage of battery life left, between 0 and 100, you can pass\n a NULL here if you don't care, will return -1 if we can't\n determine a value, or we're not running on a battery\n \\returns an SDL_PowerState enum representing the current battery state.\n\n \\since This function is available since SDL 2.0.0."] - pub fn SDL_GetPowerInfo(secs: *mut libc::c_int, pct: *mut libc::c_int) -> SDL_PowerState; + #[doc = " Get the current power supply details.\n\n You should never take a battery status as absolute truth. Batteries\n (especially failing batteries) are delicate hardware, and the values\n reported here are best estimates based on what that hardware reports. It's\n not uncommon for older batteries to lose stored power much faster than it\n reports, or completely drain when reporting it has 20 percent left, etc.\n\n Battery status can change at any time; if you are concerned with power\n state, you should call this function frequently, and perhaps ignore changes\n until they seem to be stable for a few seconds.\n\n It's possible a platform can only report battery percentage or time left\n but not both.\n\n \\param seconds seconds of battery life left, you can pass a NULL here if\n you don't care, will return -1 if we can't determine a\n value, or we're not running on a battery\n \\param percent percentage of battery life left, between 0 and 100, you can\n pass a NULL here if you don't care, will return -1 if we\n can't determine a value, or we're not running on a battery\n \\returns an SDL_PowerState enum representing the current battery state.\n\n \\since This function is available since SDL 2.0.0."] + pub fn SDL_GetPowerInfo(seconds: *mut libc::c_int, percent: *mut libc::c_int) + -> SDL_PowerState; } #[repr(u32)] #[doc = " Flags used when creating a rendering context"] @@ -16027,7 +16037,7 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Update the screen with any rendering performed since the previous call.\n\n SDL's rendering functions operate on a backbuffer; that is, calling a\n rendering function such as SDL_RenderDrawLine() does not directly put a\n line on the screen, but rather updates the backbuffer. As such, you compose\n your entire scene and *present* the composed backbuffer to the screen as a\n complete picture.\n\n Therefore, when using SDL's rendering API, one does all drawing intended\n for the frame, and then calls this function once per frame to present the\n final drawing to the user.\n\n The backbuffer should be considered invalidated after each present; do not\n assume that previous contents will exist between frames. You are strongly\n encouraged to call SDL_RenderClear() to initialize the backbuffer before\n starting each new frame's drawing, even if you plan to overwrite every\n pixel.\n\n \\param renderer the rendering context\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_RenderClear\n \\sa SDL_RenderDrawLine\n \\sa SDL_RenderDrawLines\n \\sa SDL_RenderDrawPoint\n \\sa SDL_RenderDrawPoints\n \\sa SDL_RenderDrawRect\n \\sa SDL_RenderDrawRects\n \\sa SDL_RenderFillRect\n \\sa SDL_RenderFillRects\n \\sa SDL_SetRenderDrawBlendMode\n \\sa SDL_SetRenderDrawColor"] + #[doc = " Update the screen with any rendering performed since the previous call.\n\n SDL's rendering functions operate on a backbuffer; that is, calling a\n rendering function such as SDL_RenderDrawLine() does not directly put a\n line on the screen, but rather updates the backbuffer. As such, you compose\n your entire scene and *present* the composed backbuffer to the screen as a\n complete picture.\n\n Therefore, when using SDL's rendering API, one does all drawing intended\n for the frame, and then calls this function once per frame to present the\n final drawing to the user.\n\n The backbuffer should be considered invalidated after each present; do not\n assume that previous contents will exist between frames. You are strongly\n encouraged to call SDL_RenderClear() to initialize the backbuffer before\n starting each new frame's drawing, even if you plan to overwrite every\n pixel.\n\n \\param renderer the rendering context\n\n \\threadsafety You may only call this function on the main thread. If this\n happens to work on a background thread on any given platform\n or backend, it's purely by luck and you should not rely on it\n to work next time.\n\n \\since This function is available since SDL 2.0.0.\n\n \\sa SDL_RenderClear\n \\sa SDL_RenderDrawLine\n \\sa SDL_RenderDrawLines\n \\sa SDL_RenderDrawPoint\n \\sa SDL_RenderDrawPoints\n \\sa SDL_RenderDrawRect\n \\sa SDL_RenderDrawRects\n \\sa SDL_RenderFillRect\n \\sa SDL_RenderFillRects\n \\sa SDL_SetRenderDrawBlendMode\n \\sa SDL_SetRenderDrawColor"] pub fn SDL_RenderPresent(renderer: *mut SDL_Renderer); } extern "C" { @@ -16059,7 +16069,7 @@ extern "C" { pub fn SDL_RenderGetMetalLayer(renderer: *mut SDL_Renderer) -> *mut libc::c_void; } extern "C" { - #[doc = " Get the Metal command encoder for the current frame\n\n This function returns `void *`, so SDL doesn't have to include Metal's\n headers, but it can be safely cast to an `id`.\n\n Note that as of SDL 2.0.18, this will return NULL if Metal refuses to give\n SDL a drawable to render to, which might happen if the window is\n hidden/minimized/offscreen. This doesn't apply to command encoders for\n render targets, just the window's backbacker. Check your return values!\n\n \\param renderer The renderer to query\n \\returns an `id` on success, or NULL if the\n renderer isn't a Metal renderer or there was an error.\n\n \\since This function is available since SDL 2.0.8.\n\n \\sa SDL_RenderGetMetalLayer"] + #[doc = " Get the Metal command encoder for the current frame\n\n This function returns `void *`, so SDL doesn't have to include Metal's\n headers, but it can be safely cast to an `id`.\n\n Note that as of SDL 2.0.18, this will return NULL if Metal refuses to give\n SDL a drawable to render to, which might happen if the window is\n hidden/minimized/offscreen. This doesn't apply to command encoders for\n render targets, just the window's backbuffer. Check your return values!\n\n \\param renderer The renderer to query\n \\returns an `id` on success, or NULL if the\n renderer isn't a Metal renderer or there was an error.\n\n \\since This function is available since SDL 2.0.8.\n\n \\sa SDL_RenderGetMetalLayer"] pub fn SDL_RenderGetMetalCommandEncoder(renderer: *mut SDL_Renderer) -> *mut libc::c_void; } extern "C" { @@ -25969,9 +25979,6 @@ extern "C" { extern "C" { pub fn XInitThreads() -> libc::c_int; } -extern "C" { - pub fn XFreeThreads() -> libc::c_int; -} extern "C" { pub fn XLockDisplay(arg1: *mut Display); } diff --git a/src/sdl2/controller.rs b/src/sdl2/controller.rs index 33c60ca94f..bb01377d3a 100644 --- a/src/sdl2/controller.rs +++ b/src/sdl2/controller.rs @@ -112,6 +112,17 @@ impl GameControllerSubsystem { } } + /// Return the type of the controller at index `joystick_index`. + #[doc(alias = "SDL_GameControllerTypeForIndex")] + pub fn type_for_index( + &self, + joystick_index: u32, + ) -> Result { + let joystick_index = validate_int(joystick_index, "joystick_index")?; + let raw_type = unsafe { sys::SDL_GameControllerTypeForIndex(joystick_index) }; + Ok(GameControllerType::from_ll(raw_type)) + } + /// If state is `true` controller events are processed, otherwise /// they're ignored. #[doc(alias = "SDL_GameControllerEventState")] @@ -191,6 +202,98 @@ impl GameControllerSubsystem { } } +#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[repr(i32)] +pub enum GameControllerType { + Unknown = sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_UNKNOWN as i32, + Virtual = sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_VIRTUAL as i32, + Xbox360 = sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_XBOX360 as i32, + XboxOne = sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_XBOXONE as i32, + PS3 = sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_PS3 as i32, + PS4 = sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_PS4 as i32, + PS5 = sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_PS5 as i32, + AmazonLuna = sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_AMAZON_LUNA as i32, + GoogleStadia = sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_GOOGLE_STADIA as i32, + NvidiaShield = sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NVIDIA_SHIELD as i32, + NintendoSwitchPro = sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO as i32, + NintendoSwitchJoyconLeft = + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT as i32, + NintendoSwitchJoyconRight = + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT as i32, + NintendoSwitchJoyconPair = + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR as i32, +} + +impl GameControllerType { + pub fn from_ll(bitflags: sys::SDL_GameControllerType) -> GameControllerType { + match bitflags { + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_UNKNOWN => GameControllerType::Unknown, + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_VIRTUAL => GameControllerType::Virtual, + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_XBOX360 => GameControllerType::Xbox360, + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_XBOXONE => GameControllerType::XboxOne, + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_PS3 => GameControllerType::PS3, + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_PS4 => GameControllerType::PS4, + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_PS5 => GameControllerType::PS5, + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_AMAZON_LUNA => { + GameControllerType::AmazonLuna + } + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_GOOGLE_STADIA => { + GameControllerType::GoogleStadia + } + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NVIDIA_SHIELD => { + GameControllerType::NvidiaShield + } + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO => { + GameControllerType::NintendoSwitchPro + } + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT => { + GameControllerType::NintendoSwitchJoyconLeft + } + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT => { + GameControllerType::NintendoSwitchJoyconRight + } + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR => { + GameControllerType::NintendoSwitchJoyconPair + } + + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_MAX => GameControllerType::Unknown, + } + } + + pub fn to_ll(self) -> sys::SDL_GameControllerType { + match self { + GameControllerType::Unknown => sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_UNKNOWN, + GameControllerType::Virtual => sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_VIRTUAL, + GameControllerType::Xbox360 => sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_XBOX360, + GameControllerType::XboxOne => sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_XBOXONE, + GameControllerType::PS3 => sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_PS3, + GameControllerType::PS4 => sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_PS4, + GameControllerType::PS5 => sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_PS5, + GameControllerType::AmazonLuna => { + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_AMAZON_LUNA + } + GameControllerType::GoogleStadia => { + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_GOOGLE_STADIA + } + GameControllerType::NvidiaShield => { + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NVIDIA_SHIELD + } + GameControllerType::NintendoSwitchPro => { + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO + } + GameControllerType::NintendoSwitchJoyconLeft => { + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT + } + GameControllerType::NintendoSwitchJoyconRight => { + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT + } + GameControllerType::NintendoSwitchJoyconPair => { + sys::SDL_GameControllerType::SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR + } + } + } +} + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] #[repr(i32)] pub enum Axis { @@ -404,6 +507,13 @@ impl GameController { c_str_to_string(name) } + /// Return the type of the controller + #[doc(alias = "SDL_GameControllerGetType")] + pub fn r#type(&self) -> GameControllerType { + let raw_type = unsafe { sys::SDL_GameControllerGetType(self.raw) }; + GameControllerType::from_ll(raw_type) + } + /// Return a String describing the controller's button and axis /// mappings #[doc(alias = "SDL_GameControllerMapping")] diff --git a/src/sdl2/event.rs b/src/sdl2/event.rs index 820a086b35..186adf04e9 100644 --- a/src/sdl2/event.rs +++ b/src/sdl2/event.rs @@ -409,6 +409,7 @@ pub enum DisplayEvent { Orientation(Orientation), Connected, Disconnected, + Moved, } impl DisplayEvent { @@ -431,6 +432,7 @@ impl DisplayEvent { } sys::SDL_DisplayEventID::SDL_DISPLAYEVENT_CONNECTED => DisplayEvent::Connected, sys::SDL_DisplayEventID::SDL_DISPLAYEVENT_DISCONNECTED => DisplayEvent::Disconnected, + sys::SDL_DisplayEventID::SDL_DISPLAYEVENT_MOVED => DisplayEvent::Moved, } } @@ -448,6 +450,7 @@ impl DisplayEvent { sys::SDL_DisplayEventID::SDL_DISPLAYEVENT_DISCONNECTED as u8, 0, ), + DisplayEvent::Moved => (sys::SDL_DisplayEventID::SDL_DISPLAYEVENT_MOVED as u8, 0), } } @@ -648,7 +651,7 @@ pub enum Event { precise_y: f32, /// The X position of the mouse from the window's origin mouse_x: i32, - /// The X position of the mouse from the window's origin + /// The Y position of the mouse from the window's origin mouse_y: i32, },