ArcadeRS: Update tutorials for sdl2 0.24 stack - #34
Conversation
| pub struct Phi<'window> { | ||
| pub events: Events, | ||
| pub renderer: Renderer<'window>, | ||
| pub ttf_context: Sdl2TtfContext, |
There was a problem hiding this comment.
I probably don't need to make it public actually; but I'm not sure if it's a good idea to even include it in Phi or if the font setup should be refactored a bit. I might also be missing a lifetime here, not fully familiar with those yet.
ab6d4ee to
25c03a3Compareakien-mga
commented
Oct 31, 2016
I've currently reviewed things up to chapter 10 (both code and article text). I'd like to have some feedback on the changes I made in chapter 9 particularly, where the sdl2_ttf API changes needed some important changes. Other solutions might be better from a pedagogical point of view, but I'm still learning rust myself. |
akien-mga
commented
Nov 4, 2016
Now all updated down to chapter 12, one to go :) |
Some API changes implied modifications in the code: - Most sdl2 Renderer drawing methods return Result<(), String> and need to be unwrapped - sdl2 Rect::new no longer returns Result<Option<Rect>> but directly Rect. - sdl2_ttf font loading needs to be done from the ttf context, currently worked around by adding it to Phi.
akien-mga
commented
Nov 13, 2016
Now reviewed chapter 13 too, it should be good to go. I've seen that in the meantime the sdl2 0.25 stack was released, so I'll have a look at updating (hopefully there's no API change to handle). |
akien-mga
commented
Nov 13, 2016
Ok, moving to sdl2 0.25 is not trivial as the font API changed again: Since I'm still not convinced about the font handling used right now, and since I still haven't gotten any feedback from @jadpole and my PRs conflict with most of the development done in the Hopefully it can be useful to other Rust learners who want to go through ArcadeRS with a non-yanked version of SDL2_image :) |
mrspeaker
commented
Feb 8, 2017
On the rust-sdl2-image repo it says "As of rust-sdl2v0.27 this crate is deprecated and its functionality has been moved as a feature in rust-sdl2" - does this mean we can completely skip that yanked dependency anyway now? |
Some API changes implied modifications in the code:
and need to be unwrapped
directly Rect.
currently worked around by adding it to Phi.
Note: WIP, only reviewed code and articles up to chapter 10.
I plan to continue working my way through the tutorials to adapt them all to the 0.24 libraries, but as I am pretty new to Rust, I'd be glad to have some feedback on the solutions I chose to integrate the API changes.