[−][src]Struct cat_engine::Window
Окно, включает в себя графические функции и обработчик событий. A window with graphic functions and an event listener included.
Все события обрабатываются и добавляются в очередь внешней обработки (Window.events) для работы с ними вне структуры окна.
All events are handled and added to the outer handling queue (Window.events) to work with them outside of the window structure.
Implementations
impl Window
[src]
pub fn new<F>(setting: F) -> Result<Window, DisplayCreationError> where
F: FnOnce(Vec<MonitorHandle>, &mut WindowSettings),
[src]
F: FnOnce(Vec<MonitorHandle>, &mut WindowSettings),
Создаёт окно. Принимает функцию для настройки.
Creates the window.
pub fn raw<P: AsRef<Path>>(
window_builder: WindowBuilder,
context_builder: ContextBuilder<NotCurrent>,
graphics_settings: GraphicsSettings,
event_loop: EventLoop<()>,
initial_colour: Option<Colour>,
mouse_cursor_icon_path: P,
mouse_cursor_icon_range: Range<usize>
) -> Result<Window, DisplayCreationError>
[src]
window_builder: WindowBuilder,
context_builder: ContextBuilder<NotCurrent>,
graphics_settings: GraphicsSettings,
event_loop: EventLoop<()>,
initial_colour: Option<Colour>,
mouse_cursor_icon_path: P,
mouse_cursor_icon_range: Range<usize>
) -> Result<Window, DisplayCreationError>
mouse_cursor_icon_path, mouse_cursor_icon_range - feature = "mouse_cursor_icon"
pub fn next_event(&mut self) -> Option<WindowEvent>
[src]
Возвращает следующее событие окна.
Блокирует поток, пока не получит следующее событие.
Returns next window event.
Blocks the thread until it receives the next event.
impl Window
[src]
pub fn display(&self) -> &Display
[src]
pub fn graphics(&mut self) -> &mut Graphics2D
[src]
Возвращает графическую основу.
Returns graphic base.
pub fn available_monitors(&self) -> impl Iterator<Item = MonitorHandle>
[src]
impl Window
[src]
pub fn set_inner_size<S: Into<Size>>(&self, size: S)
[src]
pub fn set_min_inner_size<S: Into<Size>>(&self, size: Option<S>)
[src]
pub fn set_max_inner_size<S: Into<Size>>(&self, size: Option<S>)
[src]
pub fn set_title(&self, title: &str)
[src]
pub fn set_visible(&self, visible: bool)
[src]
pub fn set_resizable(&self, resizable: bool)
[src]
pub fn choose_fullscreen_monitor(&self, monitor: usize) -> Result<(), ()>
[src]
pub fn set_fullscreen(&self, fullscreen: Option<Fullscreen>)
[src]
pub fn set_minimized(&self, minimized: bool)
[src]
Сворачивает окно.
Minimizes the window.
pub fn set_maximized(&self, maximized: bool)
[src]
Делает окно максимального размера.
Maximizes the window.
pub fn set_decorations(&self, decorations: bool)
[src]
pub fn set_always_on_top(&self, always_on_top: bool)
[src]
pub fn set_cursor_visible(&mut self, visible: bool)
[src]
pub fn switch_cursor_visibility(&mut self)
[src]
impl Window
[src]
pub fn get_supported_glsl_version(&self) -> Version
[src]
pub fn get_opengl_version(&self) -> &Version
[src]
impl Window
[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.
impl Window
[src]
pub fn draw_raw<F: FnOnce(&mut DrawParameters, &mut Frame)>(&self, f: F)
[src]
Даёт прямое управление над кадром.
Gives frame to raw drawing.
pub fn draw<F: FnOnce(&mut DrawParameters, &mut Graphics)>(&self, f: F)
[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
) -> f32
[src]
&mut self,
f: F
) -> f32
Выполняет замыкание (и рисует курсор, если 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 Window
[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
impl !RefUnwindSafe for Window
impl !Send for Window
impl !Sync for Window
impl Unpin for Window
impl !UnwindSafe for Window
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,