[−][src]Struct imgui_winit_support::WinitPlatform
winit backend platform state
Implementations
impl WinitPlatform
[src]
pub fn init(imgui: &mut Context) -> WinitPlatform
[src]
Initializes a winit platform instance and configures imgui.
This function configures imgui-rs in the following ways:
- backend flags are updated
- keys are configured
- platform name is set
pub fn attach_window(
&mut self,
io: &mut Io,
window: &Window,
hidpi_mode: HiDpiMode
)
[src]
&mut self,
io: &mut Io,
window: &Window,
hidpi_mode: HiDpiMode
)
Attaches the platform instance to a winit window.
This function configures imgui-rs in the following ways:
- framebuffer scale (= DPI factor) is set
- display size is set
pub fn hidpi_factor(&self) -> f64
[src]
Returns the current DPI factor.
The value might not be the same as the winit DPI factor (depends on the used DPI mode)
pub fn scale_size_from_winit(
&self,
window: &Window,
logical_size: LogicalSize<f64>
) -> LogicalSize<f64>
[src]
&self,
window: &Window,
logical_size: LogicalSize<f64>
) -> LogicalSize<f64>
Scales a logical size coming from winit using the current DPI mode.
This utility function is useful if you are using a DPI mode other than default, and want your application to use the same logical coordinates as imgui-rs.
pub fn scale_pos_from_winit(
&self,
window: &Window,
logical_pos: LogicalPosition<f64>
) -> LogicalPosition<f64>
[src]
&self,
window: &Window,
logical_pos: LogicalPosition<f64>
) -> LogicalPosition<f64>
Scales a logical position coming from winit using the current DPI mode.
This utility function is useful if you are using a DPI mode other than default, and want your application to use the same logical coordinates as imgui-rs.
pub fn scale_pos_for_winit(
&self,
window: &Window,
logical_pos: LogicalPosition<f64>
) -> LogicalPosition<f64>
[src]
&self,
window: &Window,
logical_pos: LogicalPosition<f64>
) -> LogicalPosition<f64>
Scales a logical position for winit using the current DPI mode.
This utility function is useful if you are using a DPI mode other than default, and want your application to use the same logical coordinates as imgui-rs.
pub fn handle_event<T>(
&mut self,
io: &mut Io,
window: &Window,
event: &Event<'_, T>
)
[src]
&mut self,
io: &mut Io,
window: &Window,
event: &Event<'_, T>
)
Handles a winit event.
This function performs the following actions (depends on the event):
- window size / dpi factor changes are applied
- keyboard state is updated
- mouse state is updated
pub fn prepare_frame(
&self,
io: &mut Io,
window: &Window
) -> Result<(), ExternalError>
[src]
&self,
io: &mut Io,
window: &Window
) -> Result<(), ExternalError>
Frame preparation callback.
Call this before calling the imgui-rs context frame
function.
This function performs the following actions:
- mouse cursor is repositioned (if requested by imgui-rs)
pub fn prepare_render(&mut self, ui: &Ui<'_>, window: &Window)
[src]
Render preparation callback.
Call this before calling the imgui-rs UI render_with
/render
function.
This function performs the following actions:
- mouse cursor is changed and/or hidden (if requested by imgui-rs)
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WinitPlatform
impl Send for WinitPlatform
impl Sync for WinitPlatform
impl Unpin for WinitPlatform
impl UnwindSafe for WinitPlatform
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,
pub 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, 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.
pub 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>,