2023-12-31 18:59:08 -08:00
|
|
|
#![warn(missing_docs)]
|
|
|
|
|
2024-01-01 09:55:19 -08:00
|
|
|
//! This crate contains all drawing logic.
|
2023-12-31 18:59:08 -08:00
|
|
|
//! 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 globaldata;
|
|
|
|
mod gpustate;
|
|
|
|
mod pipeline;
|
|
|
|
mod sprite;
|
2024-01-01 09:45:27 -08:00
|
|
|
mod starfield;
|
2023-12-31 18:39:37 -08:00
|
|
|
mod texturearray;
|
|
|
|
mod vertexbuffer;
|
|
|
|
|
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;
|
2024-01-02 19:11:18 -08:00
|
|
|
pub use sprite::{AnchoredUiPosition, ObjectSprite, ObjectSubSprite, ParticleBuilder, UiSprite};
|
2024-01-01 10:44:55 -08:00
|
|
|
|
|
|
|
use cgmath::Matrix4;
|
|
|
|
|
|
|
|
/// Shader entry points
|
|
|
|
pub(crate) const SHADER_MAIN_VERTEX: &'static str = "vertex_main";
|
|
|
|
pub(crate) const SHADER_MAIN_FRAGMENT: &'static str = "fragment_main";
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
pub(crate) const OPENGL_TO_WGPU_MATRIX: Matrix4<f32> = Matrix4::new(
|
|
|
|
1.0, 0.0, 0.0, 0.0,
|
|
|
|
0.0, 1.0, 0.0, 0.0,
|
|
|
|
0.0, 0.0, 0.5, 0.5,
|
|
|
|
0.0, 0.0, 0.0, 1.0,
|
|
|
|
);
|