Galactica/crates/render/src/renderinput.rs

37 lines
919 B
Rust
Raw Normal View History

2024-01-17 10:17:18 -08:00
use galactica_content::{Content, SystemHandle};
use galactica_playeragent::PlayerAgent;
2024-01-23 15:53:50 -08:00
use galactica_system::phys::PhysImage;
2024-01-17 10:17:18 -08:00
use galactica_util::timing::Timing;
use nalgebra::Vector2;
/// Bundles parameters passed to a single call to GPUState::render
pub struct RenderInput<'a> {
/// Camera position, in world units
pub camera_pos: Vector2<f32>,
/// Player ship data
pub player: &'a PlayerAgent,
/// The system we're currently in
pub current_system: SystemHandle,
/// Height of screen, in world units
pub camera_zoom: f32,
/// The world state to render
2024-01-23 15:53:50 -08:00
pub phys_img: &'a PhysImage,
2024-01-17 10:17:18 -08:00
// TODO: handle overflow. is it a problem?
/// The current time, in seconds
pub current_time: f32,
2024-01-25 21:25:21 -08:00
/// The amount of time that has passed since the last frame was drawn
pub time_since_last_run: f32,
2024-01-17 10:17:18 -08:00
/// Game content
pub ct: &'a Content,
/// Time we spent in each part of the game loop
pub timing: Timing,
}