2023-12-31 18:59:08 -08:00
|
|
|
#![warn(missing_docs)]
|
|
|
|
|
|
|
|
//! This crate contains all drawing logic and NO game logic.
|
|
|
|
//! It converts game state to a nice picture.
|
|
|
|
//!
|
|
|
|
//! [`GPUState`] is the main struct this crate provides,
|
|
|
|
//! and the only one external code should interact with.
|
|
|
|
//! (Excluding data structs, like [`ObjectSprite`])
|
|
|
|
|
2023-12-31 18:39:37 -08:00
|
|
|
mod consts;
|
|
|
|
mod globaldata;
|
|
|
|
mod gpustate;
|
|
|
|
mod pipeline;
|
|
|
|
mod sprite;
|
|
|
|
mod texturearray;
|
|
|
|
mod vertexbuffer;
|
|
|
|
|
|
|
|
// TODO: remove
|
|
|
|
mod consts_main;
|
|
|
|
|
|
|
|
use cgmath::{Point3, Vector2};
|
2023-12-31 18:48:35 -08:00
|
|
|
use galactica_content as content;
|
2023-12-31 18:39:37 -08:00
|
|
|
pub use gpustate::GPUState;
|
|
|
|
pub use sprite::{AnchoredUiPosition, ObjectSprite, ObjectSubSprite, UiSprite};
|
|
|
|
|
2023-12-31 18:59:08 -08:00
|
|
|
/// TODO: this shouldn't be here
|
2023-12-31 18:39:37 -08:00
|
|
|
pub struct StarfieldStar {
|
|
|
|
/// Star coordinates, in world space.
|
|
|
|
/// These are relative to the center of a starfield tile.
|
|
|
|
pub pos: Point3<f32>,
|
|
|
|
|
|
|
|
/// Height in game units.
|
|
|
|
/// Will be scaled for zoom, but not for distance.
|
|
|
|
pub size: f32,
|
|
|
|
|
|
|
|
/// Color/brightness variation. Random between 0 and 1.
|
|
|
|
/// Used in starfield shader.
|
|
|
|
pub tint: Vector2<f32>,
|
|
|
|
}
|