[][src]Struct pixel_engine::Window

pub struct Window {
    pub canv: Canvas<Window>,
    pub height: u32,
    pub width: u32,
    pub px_size: u32,
    pub name: String,
}

Base struct of the library contains the function to draw onto the window's canvas

Fields

canv: Canvas<Window>

The canvas's Window, not realy useful

height: u32

The Window's height, if ever useful

width: u32

The Window's width, if ever useful

px_size: u32

The Window pixel ratio, "1 pixel = px_size pixels" on the physical screen

name: String

The Window name

Methods

impl Window[src]

pub fn new(
    canvas: Canvas<Window>,
    w: u32,
    h: u32,
    pixel_size: u32,
    name: String
) -> Window
[src]

Create a new window from arguments given

pub fn clear(&mut self, col: Color)[src]

Fill the whole screen with color given

pub fn draw(&mut self, x: i32, y: i32, col: Color) -> Result<(), String>[src]

Draw a pixel at x,y

pub fn fill_rect(
    &mut self,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    col: Color
) -> Result<(), String>
[src]

Draw a filled rectangle starting a x,y with size w,h

pub fn update(&mut self)[src]

Update the window's canvas to show change

pub fn update_title(
    &mut self,
    title: &str,
    frame_count: u64
) -> Result<(), String>
[src]

Update the title of the window with format "{name} - {fps}fps"

Trait Implementations

impl Debug for Window[src]

Auto Trait Implementations

impl Unpin for Window

impl !Sync for Window

impl !Send for Window

impl !UnwindSafe for Window

impl !RefUnwindSafe for Window

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]