began writing spheretracer and realized I'll have to reimplement cgmath

(badly)
This commit is contained in:
CDaut 2025-10-02 16:12:16 +02:00
parent c6290f93fd
commit 6c88c8ddfe
Signed by: clara
GPG key ID: 223391B52FAD4463
8 changed files with 136 additions and 48 deletions

View file

@ -22,10 +22,15 @@ impl Buffer {
}
/// Get a single pixel.
pub fn pixel(&mut self, x: usize, y: usize) -> Option<&mut BltPixel> {
pub fn get_pixel(&mut self, x: usize, y: usize) -> Option<&mut BltPixel> {
self.pixels.get_mut(y * self.width + x)
}
/// Set a single pixel.
pub fn set_pixel(&mut self, x: usize, y: usize, pixel: BltPixel) {
self.pixels[y * self.width + x] = pixel;
}
/// Blit the buffer to the framebuffer.
pub fn blit(&self, gop: &mut GraphicsOutput) -> Result<(), Error> {
gop.blt(BltOp::BufferToVideo {