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

Update sdl2 to 0.32.2 #33

Merged
merged 2 commits into from
Aug 13, 2019
Merged

Update sdl2 to 0.32.2 #33

merged 2 commits into from
Aug 13, 2019

Conversation

kolen
Copy link
Contributor

@kolen kolen commented Apr 7, 2019

I couldn't built sdl2's dependency rustc-serialize on my machine, it fails with following error

error[E0642]: patterns aren't allowed in methods without bodies
   --> /Users/kolen/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.19/src/serialize.rs:147:45
    |
147 |                                             &f_name: &str,
    |                                             ^^^^^^^
...
error: aborting due to previous error

For more information about this error, try `rustc --explain E0642`.
error: Could not compile `rustc-serialize`.

So I updated sdl2 to latest version.

It had breaking changes, especially after 0.30, when Renderer was split into Canvas and TextureCreator. Also, now Texture has lifetime parameter, but it's not possible to store both TextureCreator and Textures into the same struct, because they're self-referencing. Because of this, sdl2 now has unsafe_textures feature, which is, AFAIK, similar to behavior before 0.30, and it's probably safe to use it as long as textures are not deallocated manually, and looks like rustzx does not deallocate textures prematurely.

However, I'm not sure about regressions, as there are lots of changes in sdl2. For me, it runs very slowly in debug version (in release it's ok). Probably I should first build with first working version of sdl2 and compare.

@kolen
Copy link
Contributor Author

kolen commented Apr 7, 2019

I tried to update just rustc-serialize: it works and is also slow in debug version: #35. It can be applied first before doing full update of sdl version.

@pacmancoder
Copy link
Collaborator

FYI: #34 and #35 were merged.

Update sdl2 to latest 0.32.2, update code for breaking changes in API.

For now, unsafe_textures sdl2 feature is used.
@kolen
Copy link
Contributor Author

kolen commented Apr 8, 2019

What I've checked:

kolen added a commit to kolen/rustzx that referenced this pull request Apr 8, 2019
@pacmancoder
Copy link
Collaborator

Cool, thanks for the confirmation testing. I can merge this PR after conflicts will be resolved 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants