Struct imgui_winit_support::WinitPlatform [−][src]
pub struct WinitPlatform { /* fields omitted */ }
Expand description
winit backend platform state
Implementations
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
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
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>
pub fn scale_size_from_winit(
&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>
pub fn scale_pos_from_winit(
&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>
pub fn scale_pos_for_winit(
&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.
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
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)
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)