灵符lingfu

ling-graphics

↓ 7402 downloads

3D/4D line renderer with a parallel software rasterizer

Keywords graphics, 3d, 4d, renderer, rasterizer
lingfu install ling-graphics
LicenseApache-2.0 OR MIT
AuthorsLing Lin, Sanny Lin
READMECode / FilesVersionsDependency GraphDependentsSecurityBuildsSettings

Code / Files (18)

src/viewport.rs
use crate::color::Color;

/// A logical render area (pixel dimensions + clear color).
///
/// This is renderer-agnostic: it can back a software framebuffer,
/// and later map to a real GPU/window viewport.
#[derive(Debug, Clone)]
pub struct Viewport {
    pub width: u32,
    pub height: u32,
    pub clear_color: Color,
}

impl Viewport {
    pub fn new(width: u32, height: u32, clear_color: Color) -> Self {
        Self { width, height, clear_color }
    }
}

← Back to index