dear-imgui-rs 0.14.0

High-level Rust bindings to Dear ImGui v1.92.7 with docking, WGPU/GL backends, and extensions (ImPlot/ImPlot3D, ImNodes, ImGuizmo, file browser, reflection-based UI)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::io::{Io, assert_display_framebuffer_scale};

impl Io {
    /// Get the display framebuffer scale
    pub fn display_framebuffer_scale(&self) -> [f32; 2] {
        let scale = self.inner().DisplayFramebufferScale;
        [scale.x, scale.y]
    }

    /// Set the display framebuffer scale
    /// This is important for HiDPI displays to ensure proper rendering
    pub fn set_display_framebuffer_scale(&mut self, scale: [f32; 2]) {
        assert_display_framebuffer_scale("Io::set_display_framebuffer_scale()", scale);
        self.inner_mut().DisplayFramebufferScale.x = scale[0];
        self.inner_mut().DisplayFramebufferScale.y = scale[1];
    }
}