39 lines
934 B
Rust
39 lines
934 B
Rust
#![warn(missing_docs)]
|
|
|
|
//! This crate contains all drawing 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`])
|
|
|
|
mod anchoredposition;
|
|
mod datastructs;
|
|
mod globaluniform;
|
|
mod gpustate;
|
|
mod pipeline;
|
|
mod shaderprocessor;
|
|
mod starfield;
|
|
mod texturearray;
|
|
mod ui;
|
|
mod vertexbuffer;
|
|
|
|
pub use anchoredposition::PositionAnchor;
|
|
pub use datastructs::RenderInput;
|
|
pub use gpustate::GPUState;
|
|
|
|
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]
|
|
#[allow(dead_code)]
|
|
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,
|
|
);
|