Skip to content

Commit

Permalink
external-bindings: MSVC is evil (fix more SDL enum issues)
Browse files Browse the repository at this point in the history
  • Loading branch information
caseif committed Jan 23, 2025
1 parent ea628b4 commit 8ff6da1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion external-bindings/sdl2/src/wrapper/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ pub enum SdlKeyCode {
impl SdlKeyCode {
pub fn from_scancode(scancode: SdlScancode) -> SdlKeyCode {
unsafe {
SdlKeyCode::try_from_primitive(SDL_GetKeyFromScancode((scancode as u32).into()))
SdlKeyCode::try_from_primitive(SDL_GetKeyFromScancode(scancode as SDL_Scancode))
.unwrap()
}
}
Expand Down
2 changes: 1 addition & 1 deletion external-bindings/sdl2/src/wrapper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn sdl_quit_subsystem(flags: SdlInitFlags) {
unsafe { SDL_QuitSubSystem(flags.bits()) };
}
pub fn sdl_was_init(flags: SdlInitFlags) -> bool {
unsafe { SDL_WasInit(flags.bits()) == SDL_TRUE.into() }
unsafe { SDL_WasInit(flags.bits()) == SDL_TRUE as u32 }
}
pub fn sdl_quit() {
unsafe { SDL_Quit() };
Expand Down

0 comments on commit 8ff6da1

Please sign in to comment.