pub struct Framebuffer {
info: FramebufferInfo,
pub canvas: CanvasBuffer,
double_buffer: Option<*mut u8>,
use_double_buffer: bool,
}Expand description
Main framebuffer structure
Fields§
§info: FramebufferInfo§canvas: CanvasBufferShared double-buffered canvas (dirty tracking, present throttling, SIMD ops)
double_buffer: Option<*mut u8>Raw double buffer for VirtIO GPU (physically contiguous)
use_double_buffer: boolWhether the raw double buffer should be used
Implementations§
Source§impl Framebuffer
impl Framebuffer
fn request_present(&mut self)
fn present_if_due(&mut self, force: bool)
Sourcepub fn init_limine(
addr: u64,
width: u32,
height: u32,
stride: u32,
format: PixelFormat,
) -> Result<(), &'static str>
pub fn init_limine( addr: u64, width: u32, height: u32, stride: u32, format: PixelFormat, ) -> Result<(), &'static str>
Initialize framebuffer with Limine-provided buffer
Sourcepub fn init_virtio_gpu() -> Result<(), &'static str>
pub fn init_virtio_gpu() -> Result<(), &'static str>
Initialize framebuffer with VirtIO GPU
Sourcepub fn info() -> Option<FramebufferInfo>
pub fn info() -> Option<FramebufferInfo>
Get framebuffer info
Sourcepub fn is_available() -> bool
pub fn is_available() -> bool
Check if framebuffer is initialized
Sourcepub fn source() -> FramebufferSource
pub fn source() -> FramebufferSource
Get framebuffer source
pub fn render_stats() -> Option<FramebufferRenderStats>
Sourcepub fn set_pixel(x: u32, y: u32, r: u8, g: u8, b: u8)
pub fn set_pixel(x: u32, y: u32, r: u8, g: u8, b: u8)
Set a pixel at (x, y) with RGB color.
Does NOT present to screen. Call swap_buffers() or present()
after a batch of draw operations.
Sourcepub fn fill_rect(x: u32, y: u32, width: u32, height: u32, r: u8, g: u8, b: u8)
pub fn fill_rect(x: u32, y: u32, width: u32, height: u32, r: u8, g: u8, b: u8)
Fill rectangle with color.
Does NOT present to screen. Call swap_buffers() or present()
after a batch of draw operations.
Sourcepub fn swap_buffers()
pub fn swap_buffers()
Swap buffers (for double buffering)
Sourcepub fn set_double_buffering(enable: bool)
pub fn set_double_buffering(enable: bool)
Enable/disable double buffering
Trait Implementations§
impl Send for Framebuffer
impl Sync for Framebuffer
Auto Trait Implementations§
impl Freeze for Framebuffer
impl RefUnwindSafe for Framebuffer
impl Unpin for Framebuffer
impl UnsafeUnpin for Framebuffer
impl UnwindSafe for Framebuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more