Skip to content

[New section] Add image caching #89

@NiklasEi

Description

@NiklasEi

First of all, thank you for the awesome book! I just started learning Rust and it was fun and helpful to build the game.

I had the issue that even after implementing batch rendering the FPS were somewhere between 40 and 50, but never 60. After finishing the book I continued playing around with the code trying to reach 60 FPS. I managed by introducing a cache for the images. Now the game reaches 60 FPS after a few seconds. Would this be an addition to the book you would be interested in?

I am not sure if my implementation is well done (really new to rust), but if you are interested:
The biggest change is https://github.com/NiklasEi/sokoban-rust/blob/master/src/systems/rendering_system.rs#L56-L63

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions