[][src]Struct cat_engine::WindowBase

pub struct WindowBase<E: 'static> {
    pub display: Display,
    pub graphics: Graphics2D,
    pub event_loop: EventLoop<E>,
    pub frames_passed: u32,
    pub time: Instant,
    pub alpha_channel: f32,
    pub smooth: f32,
    pub mouse_icon: MouseCursorIcon,
}

Окно, включает в себя графические функции. A window with graphic functions included.

Fields

display: Displaygraphics: Graphics2Devent_loop: EventLoop<E>frames_passed: u32

feature = "fps_counter"

time: Instant

feature = "fps_counter"

alpha_channel: f32

feature = "alpha_smoothing"

smooth: f32

feature = "alpha_smoothing"

mouse_icon: MouseCursorIcon

feature = "mouse_cursor_icon"

Implementations

impl<E: 'static> WindowBase<E>[src]

pub fn raw(
    window_builder: WindowBuilder,
    context_builder: ContextBuilder<NotCurrent>,
    graphics_settings: GraphicsSettings,
    event_loop: EventLoop<E>,
    initial_colour: Option<Colour>,
    mouse_cursor_icon_settings: MouseCursorIconSettings<PathBuf>
) -> Result<WindowBase<E>, DisplayCreationError>
[src]

impl<E: 'static> WindowBase<E>[src]

Функции для рисования. Drawing functions.

pub fn draw_raw<F: FnOnce(&mut DrawParameters, &mut Frame)>(
    &self,
    f: F
) -> Result<(), SwapBuffersError>
[src]

Даёт прямое управление над кадром.

Gives frame to raw drawing.

pub fn draw<F: FnOnce(&mut DrawParameters, &mut Graphics)>(
    &self,
    f: F
) -> Result<(), SwapBuffersError>
[src]

Выполняет замыкание (и рисует курсор, если feature = "mouse_cursor_icon").

Executes the closure (and draws the mouse cursor if feature = "mouse_cursor_icon").

pub fn draw_smooth<F: FnOnce(f32, &mut DrawParameters, &mut Graphics)>(
    &mut self,
    f: F
) -> Result<f32, SwapBuffersError>
[src]

Выполняет замыкание (и рисует курсор, если feature = "mouse_cursor_icon"). Выдаёт альфа-канал, возвращает его следующее значение.

Нужна для рисования с изменяющимся альфа-канала.

Executes closure (and draws the mouse cursor if feature = "mouse_cursor_icon"). Gives alpha channel, returns it's next value.

Needed for drawing with changing alpha channel.

feature = "alpha_smoothing"

impl<E: 'static> WindowBase<E>[src]

pub fn set_user_cursor_visible(&mut self, visible: bool)[src]

feature = "mouse_cursor_icon

pub fn switch_cursor_visibility(&mut self)[src]

feature = "mouse_cursor_icon

pub fn screenshot(&self) -> Option<DynamicImage>[src]

Возвращает скриншот.

Returns a screenshot.

pub fn save_screenshot<P: AsRef<Path>>(&self, path: P)[src]

Сохраняет скриншот в формате png.

Saves a screenshot in png format.

impl<E: 'static> WindowBase<E>[src]

pub fn set_alpha(&mut self, alpha: f32)[src]

Sets alpha channel for smooth drawing.

pub fn set_smooth(&mut self, smooth: f32)[src]

Sets smooth for smooth drawing.

pub fn set_new_smooth(&mut self, smooth: f32)[src]

Sets smooth and zero alpha channel for smooth drawing.

Auto Trait Implementations

impl<E> !RefUnwindSafe for WindowBase<E>

impl<E> !Send for WindowBase<E>

impl<E> !Sync for WindowBase<E>

impl<E> Unpin for WindowBase<E> where
    E: Unpin

impl<E> !UnwindSafe for WindowBase<E>

Blanket Implementations

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

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

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

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

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

impl<T> SetParameter for T

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.