Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade SDL version of bundled feature #1077

Closed
joao-conde opened this issue Mar 15, 2021 · 3 comments
Closed

Upgrade SDL version of bundled feature #1077

joao-conde opened this issue Mar 15, 2021 · 3 comments
Labels
build-process Everything related to build.rs, or the build process in general

Comments

@joao-conde
Copy link
Contributor

joao-conde commented Mar 15, 2021

SDL2.0.12 currently used by the bundled feature is bugged.

Running a profiler on my code using this crate:

image

This WIN_UpdateCursorClip and SDL_POLL_EVENT were super slow. I had this in my main game loop:

while let Some(event) = event_pump.poll_event() {
      match event {
          sdl2::event::Event::Quit { .. } => break 'main,
          sdl2::event::Event::KeyDown {
            keycode: Some(Keycode::Escape),
                  ..
           } => break 'main,
           _ => {}
      }
}

I commented out event processing and it runs at normal speed.

Further investigated and stumbled upon this: https://stackoverflow.com/questions/58639564/why-is-sdl-pollevent-so-slow
Seems however it was fixed in 2.0.14: libsdl-org/SDL#3717

Hence, I propose the bundled feature should download SDL2.0.14

Point me to relevant code and I can open the PR myself if need be :)

@Cobrand
Copy link
Member

Cobrand commented Mar 16, 2021

I am pretty sure someone mentioned this exact same issue in the past for 2.0.12, but I can't find it anymore... They proposed we either revert to 2.0.10 or upgrade to 2.0.14 too...

Regardless, you are more than welcome to create the relevant PR.

Relevant code to change: https://github.com/Rust-SDL2/rust-sdl2/blob/master/sdl2-sys/build.rs#L26

You may have to look into this as well: https://github.com/Rust-SDL2/rust-sdl2/blob/master/sdl2-sys/build.rs#L176 , there were several patches that were specific to 2.0.12 that may not apply to 2.0.14 anymore, so you may have to remove them as well.

@Cobrand Cobrand added the build-process Everything related to build.rs, or the build process in general label Mar 16, 2021
@joao-conde
Copy link
Contributor Author

Do you prefer to downgrade it to 2.0.10 or upgrade it?

@joao-conde
Copy link
Contributor Author

Solved by #1086

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-process Everything related to build.rs, or the build process in general
Projects
None yet
Development

No branches or pull requests

2 participants