[][src]Struct cat_engine::WindowBase

pub struct WindowBase {
    pub display: Display,
    pub graphics2d: Graphics2D,
    pub event_loop: EventLoop<InnerWindowEvent>,
    pub event_loop_proxy: EventLoopProxy<InnerWindowEvent>,
    pub update_interval: Duration,
    pub next_update: Instant,
    pub frames_passed: u32,
    pub time: Instant,
}

Основа для окон для создания более сложных окон. A window base for creating more complex windows.

Fields

display: Display

A window with a GL context.

graphics2d: Graphics2D

A graphics base for 2D rendering.

event_loop: EventLoop<InnerWindowEvent>

An event loop.

event_loop_proxy: EventLoopProxy<InnerWindowEvent>

Used to send custom events to the event loop.

update_interval: Duration

feature != "lazy"

next_update: Instant

feature != "lazy"

frames_passed: u32

feature = "fps_counter"

time: Instant

feature = "fps_counter"

Implementations

impl WindowBase[src]

pub fn raw(
    window_builder: WindowBuilder,
    context_builder: ContextBuilder<'_, NotCurrent>,
    graphics_settings: GraphicsSettings,
    event_loop: EventLoop<InnerWindowEvent>,
    general_settings: GeneralSettings
) -> Result<WindowBase, DisplayCreationError>
[src]

pub fn request_event_loop_close(
    &self
) -> Result<(), EventLoopClosed<InnerWindowEvent>>
[src]

Останавливает цикл событий, отправляя событие для остановки.

Возвращает Err, если цикл уже остановлен.

Stops the event loop by sending the stopping event.

Returns Err if the loop has been already stopped.

impl WindowBase[src]

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

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

Выполняет замыкание.

Executes the closure.

impl WindowBase[src]

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.

Auto Trait Implementations

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, 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.