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-04 17:18:31 -08:00
|
|
|
mod globaluniform;
|
2023-12-31 18:39:37 -08:00
|
|
|
mod gpustate;
|
|
|
|
mod pipeline;
|
2024-01-17 10:17:18 -08:00
|
|
|
mod positionanchor;
|
|
|
|
mod renderinput;
|
|
|
|
mod renderstate;
|
2024-01-10 17:53:27 -08:00
|
|
|
mod shaderprocessor;
|
2024-01-01 09:45:27 -08:00
|
|
|
mod starfield;
|
2023-12-31 18:39:37 -08:00
|
|
|
mod texturearray;
|
2024-01-10 17:53:27 -08:00
|
|
|
mod ui;
|
2023-12-31 18:39:37 -08:00
|
|
|
mod vertexbuffer;
|
|
|
|
|
2024-01-17 10:17:18 -08:00
|
|
|
use renderstate::*;
|
|
|
|
|
2023-12-31 18:39:37 -08:00
|
|
|
pub use gpustate::GPUState;
|
2024-01-17 10:17:18 -08:00
|
|
|
pub use positionanchor::PositionAnchor;
|
|
|
|
pub use renderinput::RenderInput;
|
|
|
|
|
2024-01-12 22:47:40 -08:00
|
|
|
use nalgebra::Matrix4;
|
2024-01-01 10:44:55 -08:00
|
|
|
|
|
|
|
/// 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,
|
|
|
|
);
|