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

Move core initialization to load_game for better ergonomics #4

Merged
3 commits merged into from Nov 23, 2022

Conversation

InquisitiveCoder
Copy link
Contributor

Addesses Issue #3: Move RetroCore instantiation to load_game for better ergonomics. Below is a summary of the changes:

  • retro_init and retro_deinit are now no-ops.
  • Removed RetroCore::init.
  • RetroLoadGameResult contains an additional field for the RetroCore instance.
  • RetroCore::load_game is now a function.
  • Removed RetroInstance::on_init and on_deinit. The code has been moved to on_load_game and on_unload_game respectively.

With these changes, users of the crate return a fully initialized instance from RetroCore::load_game rather than return a partially initialized instance from init and updating it in load_game.

Since this isn't a backwards-compatible change, I've updated the minor digit of the version number.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I have a few notes, mostly questions around libretro lifecycle that I'd like to hash out before merging.

libretro-rs/src/core_macro.rs Outdated Show resolved Hide resolved
libretro-rs/src/lib.rs Outdated Show resolved Hide resolved
libretro-rs/src/lib.rs Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Nov 23, 2022

Thanks for submitting this PR! I've reverted the change to the version number, as I'll bump that when the time comes for the next release. Feel free to submit more as you see fit!

@ghost ghost merged commit faff74a into libretro-rs:master Nov 23, 2022
@ghost ghost added this to the 0.2.0 milestone Nov 24, 2022
@InquisitiveCoder InquisitiveCoder deleted the no-init branch November 28, 2022 04:11
This pull request was closed.
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