#[repr(C)]pub struct DrawData {
pub total_idx_count: i32,
pub total_vtx_count: i32,
pub display_pos: [f32; 2],
pub display_size: [f32; 2],
pub framebuffer_scale: [f32; 2],
/* private fields */
}
Expand description
All draw data to render a Dear ImGui frame.
Fields§
§total_idx_count: i32
For convenience, sum of all draw list index buffer sizes.
total_vtx_count: i32
For convenience, sum of all draw list vertex buffer sizes.
display_pos: [f32; 2]
Upper-left position of the viewport to render.
(= upper-left corner of the orthogonal projection matrix to use)
display_size: [f32; 2]
Size of the viewport to render.
(= display_pos + display_size == lower-right corner of the orthogonal matrix to use)
framebuffer_scale: [f32; 2]
Amount of pixels for each unit of display_size.
Based on io.display_frame_buffer_scale. Typically [1.0, 1.0] on normal displays, and [2.0, 2.0] on Retina displays, but fractional values are also possible.
Implementations§
Source§impl DrawData
impl DrawData
Sourcepub fn draw_lists(&self) -> DrawListIterator<'_> ⓘ
pub fn draw_lists(&self) -> DrawListIterator<'_> ⓘ
Returns an iterator over the draw lists included in the draw data.
Sourcepub fn draw_lists_count(&self) -> usize
pub fn draw_lists_count(&self) -> usize
Returns the number of draw lists included in the draw data.
Sourcepub fn deindex_all_buffers(&mut self)
pub fn deindex_all_buffers(&mut self)
Converts all buffers from indexed to non-indexed, in case you cannot render indexed buffers.
This is slow and most likely a waste of resources. Always prefer indexed rendering!
Sourcepub fn scale_clip_rects(&mut self, fb_scale: Vector2<f32>)
pub fn scale_clip_rects(&mut self, fb_scale: Vector2<f32>)
Scales the clip rect of each draw command.
Can be used if your final output buffer is at a different scale than imgui-rs expects, or if there is a difference between your window resolution and framebuffer resolution.
Trait Implementations§
Source§impl From<&DrawData> for OwnedDrawData
impl From<&DrawData> for OwnedDrawData
Source§fn from(value: &DrawData) -> OwnedDrawData
fn from(value: &DrawData) -> OwnedDrawData
Construct OwnedDrawData
from DrawData
by creating a heap-allocated deep copy of the given DrawData
Source§impl RawCast<ImDrawData> for DrawData
impl RawCast<ImDrawData> for DrawData
Source§unsafe fn from_raw_mut(raw: &mut T) -> &mut Self
unsafe fn from_raw_mut(raw: &mut T) -> &mut Self
Auto Trait Implementations§
impl Freeze for DrawData
impl RefUnwindSafe for DrawData
impl !Send for DrawData
impl !Sync for DrawData
impl Unpin for DrawData
impl UnwindSafe for DrawData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more