Files
phy/bevy_window/index.html
Orion Kindel 0ce894e6b0 doc
2025-03-18 10:30:23 -05:00

14 lines
20 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="`bevy_window` provides a platform-agnostic interface for windowing in Bevy."><title>bevy_window - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bevy_window" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="icon" href="https://bevyengine.org/assets/icon.png"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../bevy_window/index.html"><img src="https://bevyengine.org/assets/icon.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../bevy_window/index.html"><img src="https://bevyengine.org/assets/icon.png" alt="logo"></a><h2><a href="../bevy_window/index.html">bevy_<wbr>window</a><span class="version">0.15.1</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#modules">Crate Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>bevy_window</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/bevy_window/lib.rs.html#1-200">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>bevy_window</code> provides a platform-agnostic interface for windowing in Bevy.</p>
<p>This crate contains types for window management and events,
used by windowing implementors such as <code>bevy_winit</code>.
The <a href="struct.WindowPlugin.html" title="struct bevy_window::WindowPlugin"><code>WindowPlugin</code></a> sets up some global window-related parameters and
is part of the <a href="https://docs.rs/bevy/latest/bevy/struct.DefaultPlugins.html"><code>DefaultPlugins</code></a>.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="prelude/index.html" title="mod bevy_window::prelude">prelude</a></div><div class="desc docblock-short">The windowing prelude.</div></li></ul><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.ClosingWindow.html" title="struct bevy_window::ClosingWindow">Closing<wbr>Window</a></div><div class="desc docblock-short">Marker component for a <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a> that has been requested to close and
is in the process of closing (on the next frame).</div></li><li><div class="item-name"><a class="struct" href="struct.CursorEntered.html" title="struct bevy_window::CursorEntered">Cursor<wbr>Entered</a></div><div class="desc docblock-short">An event that is sent whenever the users cursor enters a window.</div></li><li><div class="item-name"><a class="struct" href="struct.CursorLeft.html" title="struct bevy_window::CursorLeft">Cursor<wbr>Left</a></div><div class="desc docblock-short">An event that is sent whenever the users cursor leaves a window.</div></li><li><div class="item-name"><a class="struct" href="struct.CursorMoved.html" title="struct bevy_window::CursorMoved">Cursor<wbr>Moved</a></div><div class="desc docblock-short">An event reporting that the mouse cursor has moved inside a window.</div></li><li><div class="item-name"><a class="struct" href="struct.CursorOptions.html" title="struct bevy_window::CursorOptions">Cursor<wbr>Options</a></div><div class="desc docblock-short">Cursor data for a <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.EnabledButtons.html" title="struct bevy_window::EnabledButtons">Enabled<wbr>Buttons</a></div><div class="desc docblock-short">Specifies which <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a> control buttons should be enabled.</div></li><li><div class="item-name"><a class="struct" href="struct.InternalWindowState.html" title="struct bevy_window::InternalWindowState">Internal<wbr>Window<wbr>State</a></div><div class="desc docblock-short">Stores internal <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a> state that isnt directly accessible.</div></li><li><div class="item-name"><a class="struct" href="struct.Monitor.html" title="struct bevy_window::Monitor">Monitor</a></div><div class="desc docblock-short">Represents an available monitor as reported by the users operating system, which can be used
to query information about the display, such as its size, position, and video modes.</div></li><li><div class="item-name"><a class="struct" href="struct.NormalizedWindowRef.html" title="struct bevy_window::NormalizedWindowRef">Normalized<wbr>Window<wbr>Ref</a></div><div class="desc docblock-short">A flattened representation of a window reference for equality/hashing purposes.</div></li><li><div class="item-name"><a class="struct" href="struct.PrimaryMonitor.html" title="struct bevy_window::PrimaryMonitor">Primary<wbr>Monitor</a></div><div class="desc docblock-short">A marker component for the primary monitor</div></li><li><div class="item-name"><a class="struct" href="struct.PrimaryWindow.html" title="struct bevy_window::PrimaryWindow">Primary<wbr>Window</a></div><div class="desc docblock-short">Marker <a href="../bevy_ecs/component/trait.Component.html" title="trait bevy_ecs::component::Component"><code>Component</code></a> for the window considered the primary window.</div></li><li><div class="item-name"><a class="struct" href="struct.RawHandleWrapper.html" title="struct bevy_window::RawHandleWrapper">RawHandle<wbr>Wrapper</a></div><div class="desc docblock-short">A wrapper over <a href="../raw_window_handle/enum.RawWindowHandle.html" title="enum raw_window_handle::RawWindowHandle"><code>RawWindowHandle</code></a> and <a href="../raw_window_handle/enum.RawDisplayHandle.html" title="enum raw_window_handle::RawDisplayHandle"><code>RawDisplayHandle</code></a> that allows us to safely pass it across threads.</div></li><li><div class="item-name"><a class="struct" href="struct.RawHandleWrapperHolder.html" title="struct bevy_window::RawHandleWrapperHolder">RawHandle<wbr>Wrapper<wbr>Holder</a></div><div class="desc docblock-short">Holder of the <a href="struct.RawHandleWrapper.html" title="struct bevy_window::RawHandleWrapper"><code>RawHandleWrapper</code></a> with wrappers, to allow use in asynchronous context</div></li><li><div class="item-name"><a class="struct" href="struct.RequestRedraw.html" title="struct bevy_window::RequestRedraw">Request<wbr>Redraw</a></div><div class="desc docblock-short">An event that indicates all of the applications windows should be redrawn,
even if their control flow is set to <code>Wait</code> and there have been no window events.</div></li><li><div class="item-name"><a class="struct" href="struct.ThreadLockedRawWindowHandleWrapper.html" title="struct bevy_window::ThreadLockedRawWindowHandleWrapper">Thread<wbr>Locked<wbr>RawWindow<wbr>Handle<wbr>Wrapper</a></div><div class="desc docblock-short">A <a href="struct.RawHandleWrapper.html" title="struct bevy_window::RawHandleWrapper"><code>RawHandleWrapper</code></a> that cannot be sent across threads.</div></li><li><div class="item-name"><a class="struct" href="struct.VideoMode.html" title="struct bevy_window::VideoMode">Video<wbr>Mode</a></div><div class="desc docblock-short">Represents a video mode that a monitor supports</div></li><li><div class="item-name"><a class="struct" href="struct.Window.html" title="struct bevy_window::Window">Window</a></div><div class="desc docblock-short">The defining <a href="../bevy_ecs/component/trait.Component.html" title="trait bevy_ecs::component::Component"><code>Component</code></a> for window entities,
storing information about how it should appear and behave.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowBackendScaleFactorChanged.html" title="struct bevy_window::WindowBackendScaleFactorChanged">Window<wbr>Backend<wbr>Scale<wbr>Factor<wbr>Changed</a></div><div class="desc docblock-short">An event that indicates a windows OS-reported scale factor has changed.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowCloseRequested.html" title="struct bevy_window::WindowCloseRequested">Window<wbr>Close<wbr>Requested</a></div><div class="desc docblock-short">An event that is sent whenever the operating systems requests that a window
be closed. This will be sent when the close button of the window is pressed.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowClosed.html" title="struct bevy_window::WindowClosed">Window<wbr>Closed</a></div><div class="desc docblock-short">An event that is sent whenever a window is closed. This will be sent when
the window entity loses its <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a> component or is despawned.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowClosing.html" title="struct bevy_window::WindowClosing">Window<wbr>Closing</a></div><div class="desc docblock-short">An event that is sent whenever a window is closing. This will be sent when
after a <a href="struct.WindowCloseRequested.html" title="struct bevy_window::WindowCloseRequested"><code>WindowCloseRequested</code></a> event is received and the window is in the process of closing.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowCreated.html" title="struct bevy_window::WindowCreated">Window<wbr>Created</a></div><div class="desc docblock-short">An event that is sent whenever a new window is created.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowDestroyed.html" title="struct bevy_window::WindowDestroyed">Window<wbr>Destroyed</a></div><div class="desc docblock-short">An event that is sent whenever a window is destroyed by the underlying window system.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowFocused.html" title="struct bevy_window::WindowFocused">Window<wbr>Focused</a></div><div class="desc docblock-short">An event that indicates a window has received or lost focus.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowMoved.html" title="struct bevy_window::WindowMoved">Window<wbr>Moved</a></div><div class="desc docblock-short">An event that is sent when a window is repositioned in physical pixels.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowOccluded.html" title="struct bevy_window::WindowOccluded">Window<wbr>Occluded</a></div><div class="desc docblock-short">The window has been occluded (completely hidden from view).</div></li><li><div class="item-name"><a class="struct" href="struct.WindowPlugin.html" title="struct bevy_window::WindowPlugin">Window<wbr>Plugin</a></div><div class="desc docblock-short">A <a href="../bevy_app/plugin/trait.Plugin.html" title="trait bevy_app::plugin::Plugin"><code>Plugin</code></a> that defines an interface for windowing support in Bevy.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowResizeConstraints.html" title="struct bevy_window::WindowResizeConstraints">Window<wbr>Resize<wbr>Constraints</a></div><div class="desc docblock-short">The size limits on a <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowResized.html" title="struct bevy_window::WindowResized">Window<wbr>Resized</a></div><div class="desc docblock-short">A window event that is sent whenever a windows logical size has changed.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowResolution.html" title="struct bevy_window::WindowResolution">Window<wbr>Resolution</a></div><div class="desc docblock-short">Controls the size of a <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a></div></li><li><div class="item-name"><a class="struct" href="struct.WindowScaleFactorChanged.html" title="struct bevy_window::WindowScaleFactorChanged">Window<wbr>Scale<wbr>Factor<wbr>Changed</a></div><div class="desc docblock-short">An event that indicates a windows scale factor has changed.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowThemeChanged.html" title="struct bevy_window::WindowThemeChanged">Window<wbr>Theme<wbr>Changed</a></div><div class="desc docblock-short">An event sent when the system theme changes for a window.</div></li><li><div class="item-name"><a class="struct" href="struct.WindowWrapper.html" title="struct bevy_window::WindowWrapper">Window<wbr>Wrapper</a></div><div class="desc docblock-short">A wrapper over a window.</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.AppLifecycle.html" title="enum bevy_window::AppLifecycle">AppLifecycle</a></div><div class="desc docblock-short">Application lifetime events</div></li><li><div class="item-name"><a class="enum" href="enum.CompositeAlphaMode.html" title="enum bevy_window::CompositeAlphaMode">Composite<wbr>Alpha<wbr>Mode</a></div><div class="desc docblock-short">Specifies how the alpha channel of the textures should be handled during compositing, for a <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a>.</div></li><li><div class="item-name"><a class="enum" href="enum.CursorGrabMode.html" title="enum bevy_window::CursorGrabMode">Cursor<wbr>Grab<wbr>Mode</a></div><div class="desc docblock-short">Defines if and how the cursor is grabbed by a <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a>.</div></li><li><div class="item-name"><a class="enum" href="enum.ExitCondition.html" title="enum bevy_window::ExitCondition">Exit<wbr>Condition</a></div><div class="desc docblock-short">Defines the specific conditions the application should exit on</div></li><li><div class="item-name"><a class="enum" href="enum.FileDragAndDrop.html" title="enum bevy_window::FileDragAndDrop">File<wbr>Drag<wbr>AndDrop</a></div><div class="desc docblock-short">Events related to files being dragged and dropped on a window.</div></li><li><div class="item-name"><a class="enum" href="enum.Ime.html" title="enum bevy_window::Ime">Ime</a></div><div class="desc docblock-short">A Input Method Editor event.</div></li><li><div class="item-name"><a class="enum" href="enum.MonitorSelection.html" title="enum bevy_window::MonitorSelection">Monitor<wbr>Selection</a></div><div class="desc docblock-short">References a screen monitor.</div></li><li><div class="item-name"><a class="enum" href="enum.PresentMode.html" title="enum bevy_window::PresentMode">Present<wbr>Mode</a></div><div class="desc docblock-short">Presentation mode for a <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a>.</div></li><li><div class="item-name"><a class="enum" href="enum.SystemCursorIcon.html" title="enum bevy_window::SystemCursorIcon">System<wbr>Cursor<wbr>Icon</a></div><div class="desc docblock-short">The icon to display for a window.</div></li><li><div class="item-name"><a class="enum" href="enum.WindowEvent.html" title="enum bevy_window::WindowEvent">Window<wbr>Event</a></div><div class="desc docblock-short">Wraps all <code>bevy_window</code> and <code>bevy_input</code> events in a common enum.</div></li><li><div class="item-name"><a class="enum" href="enum.WindowLevel.html" title="enum bevy_window::WindowLevel">Window<wbr>Level</a></div><div class="desc docblock-short">Specifies where a <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a> should appear relative to other overlapping windows (on top or under) .</div></li><li><div class="item-name"><a class="enum" href="enum.WindowMode.html" title="enum bevy_window::WindowMode">Window<wbr>Mode</a></div><div class="desc docblock-short">Defines the way a <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a> is displayed.</div></li><li><div class="item-name"><a class="enum" href="enum.WindowPosition.html" title="enum bevy_window::WindowPosition">Window<wbr>Position</a></div><div class="desc docblock-short">Defines where a <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a> should be placed on the screen.</div></li><li><div class="item-name"><a class="enum" href="enum.WindowRef.html" title="enum bevy_window::WindowRef">Window<wbr>Ref</a></div><div class="desc docblock-short">Reference to a <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a>, whether it be a direct link to a specific entity or
a more vague defaulting choice.</div></li><li><div class="item-name"><a class="enum" href="enum.WindowTheme.html" title="enum bevy_window::WindowTheme">Window<wbr>Theme</a></div><div class="desc docblock-short">The <a href="struct.Window.html" title="struct bevy_window::Window"><code>Window</code></a> theme variant to use.</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.close_when_requested.html" title="fn bevy_window::close_when_requested">close_<wbr>when_<wbr>requested</a></div><div class="desc docblock-short">Close windows in response to <a href="struct.WindowCloseRequested.html" title="struct bevy_window::WindowCloseRequested"><code>WindowCloseRequested</code></a> (e.g. when the close button is pressed).</div></li><li><div class="item-name"><a class="fn" href="fn.exit_on_all_closed.html" title="fn bevy_window::exit_on_all_closed">exit_<wbr>on_<wbr>all_<wbr>closed</a></div><div class="desc docblock-short">Exit the application when there are no open windows.</div></li><li><div class="item-name"><a class="fn" href="fn.exit_on_primary_closed.html" title="fn bevy_window::exit_on_primary_closed">exit_<wbr>on_<wbr>primary_<wbr>closed</a></div><div class="desc docblock-short">Exit the application when the primary window has been closed</div></li></ul></section></div></main></body></html>