Skip to content

Commit

Permalink
letsplay_runner_core: Make it a bit more clear games run in their own…
Browse files Browse the repository at this point in the history
… OS thread

Techinically it's an implementation detail, but it's pretty obvious based on logging, since the user can see other thread names (including the one used for the game). Might as well spell it out.
  • Loading branch information
modeco80 committed Jan 29, 2025
1 parent d6fa3d6 commit 0aff4c5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/letsplay_runner_core/src/client/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ use super::GraphicsContexts;
use std::time::Instant;

/// A game that should be run by the runner core.
/// A runner implementation implements this trait.
///
/// # Implementation notes
/// `letsplay_runner_core` spawns off another OS thread to run implementations of this trait on.
/// Note that games only run on that thread, nothing else.
pub trait Game {
/// Do any initalization tasks. Graphics contexts are provided
fn init(&mut self, graphics_contexts: &GraphicsContexts, encoder_control: &Control);
Expand All @@ -20,7 +23,7 @@ pub trait Game {

// We'll need input + video frame stuff too

/// Runs a single frame of the game. Should not sleep, [Game::wait_for_next_frame]
/// Runs a single frame of the game. Should not sleep, since [Game::wait_for_next_frame]
/// will sleep until the next frame (if required).
fn run_frame(&mut self);

Expand Down

0 comments on commit 0aff4c5

Please sign in to comment.