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`])
|
|
|
|
|
2024-01-08 17:57:49 -08:00
|
|
|
mod anchoredposition;
|
2024-01-04 17:18:31 -08:00
|
|
|
mod globaluniform;
|
2023-12-31 18:39:37 -08:00
|
|
|
mod gpustate;
|
|
|
|
mod pipeline;
|
2024-01-04 17:18:31 -08:00
|
|
|
mod renderstate;
|
2024-01-01 09:45:27 -08:00
|
|
|
mod starfield;
|
2023-12-31 18:39:37 -08:00
|
|
|
mod texturearray;
|
|
|
|
mod vertexbuffer;
|
|
|
|
|
2024-01-08 17:57:49 -08:00
|
|
|
pub use anchoredposition::PositionAnchor;
|
2023-12-31 18:39:37 -08:00
|
|
|
pub use gpustate::GPUState;
|
2024-01-04 17:18:31 -08:00
|
|
|
pub use renderstate::RenderState;
|
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]
|
2024-01-08 15:17:20 -08:00
|
|
|
#[allow(dead_code)]
|
2024-01-01 10:44:55 -08:00
|
|
|
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,
|
|
|
|
);
|