pub struct Renderer {
pub description: String,
/* private fields */
}Expand description
The renderer, on a window surface or an offscreen texture.
Fields§
§description: StringAdapter and format, for logs.
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn offscreen(width: u32, height: u32) -> Result<Self, String>
pub fn offscreen(width: u32, height: u32) -> Result<Self, String>
Draw into an offscreen Rgba8Unorm texture (the pixel host, tests).
Sourcepub unsafe fn on_window(
display: RawDisplayHandle,
window: RawWindowHandle,
width: u32,
height: u32,
) -> Result<Self, String>
pub unsafe fn on_window( display: RawDisplayHandle, window: RawWindowHandle, width: u32, height: u32, ) -> Result<Self, String>
pub fn resize(&mut self, width: u32, height: u32)
Sourcepub fn read_pixels(&self) -> Option<Vec<u32>>
pub fn read_pixels(&self) -> Option<Vec<u32>>
The offscreen pixels as 0x00RRGGBB (None on a window).
pub fn max_texture(&self) -> u32
Sourcepub unsafe fn draw(&mut self, frame: &MouserFrame) -> c_int
pub unsafe fn draw(&mut self, frame: &MouserFrame) -> c_int
Draw (and present on a window). DRAW_AGAIN when the surface was reset.
§Safety
The frame’s pointers must be valid for the call.
Auto Trait Implementations§
impl !Freeze for Renderer
impl !RefUnwindSafe for Renderer
impl !UnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnsafeUnpin for Renderer
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