Galactica/crates/render/src/lib.rs

38 lines
939 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 globaluniform;
mod gpustate;
mod pipeline;
mod renderstate;
mod starfield;
mod texturearray;
mod vertexbuffer;
pub use anchoredposition::PositionAnchor;
use galactica_content as content;
pub use gpustate::GPUState;
pub use renderstate::RenderState;
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,
);