began writing spheretracer and realized I'll have to reimplement cgmath
(badly)
This commit is contained in:
parent
c6290f93fd
commit
6c88c8ddfe
8 changed files with 136 additions and 48 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue