mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Merge pull request #1333 from proudmuslim-dev/patch-5
Move import to sensible location in chapter 3
This commit is contained in:
@@ -149,8 +149,6 @@ In the new module, we create basic structs for representing pixel positions and
|
|||||||
```rust ,hl_lines=3-16
|
```rust ,hl_lines=3-16
|
||||||
// in new kernel/src/framebuffer.rs file
|
// in new kernel/src/framebuffer.rs file
|
||||||
|
|
||||||
use bootloader_api::info::FrameBuffer;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub struct Position {
|
pub struct Position {
|
||||||
pub x: usize,
|
pub x: usize,
|
||||||
@@ -180,7 +178,7 @@ Next, we create a function for setting a specific pixel in the framebuffer to a
|
|||||||
```rust ,hl_lines=3 5-39
|
```rust ,hl_lines=3 5-39
|
||||||
// in new kernel/src/framebuffer.rs file
|
// in new kernel/src/framebuffer.rs file
|
||||||
|
|
||||||
use bootloader_api::info::PixelFormat;
|
use bootloader_api::info::{FrameBuffer, PixelFormat};
|
||||||
|
|
||||||
pub fn set_pixel_in(framebuffer: &mut FrameBuffer, position: Position, color: Color) {
|
pub fn set_pixel_in(framebuffer: &mut FrameBuffer, position: Position, color: Color) {
|
||||||
let info = framebuffer.info();
|
let info = framebuffer.info();
|
||||||
|
|||||||
Reference in New Issue
Block a user