pub struct Renderer { /* private fields */ }Expand description
Vulkan renderer for Dear ImGui draw data.
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn new(
imgui: &mut Context,
create_info: &RendererCreateInfo,
) -> Result<Self, RendererError>
pub fn new( imgui: &mut Context, create_info: &RendererCreateInfo, ) -> Result<Self, RendererError>
Create a new Vulkan renderer.
Builds the graphics pipeline, uploads the font atlas, and allocates
initial vertex/index buffers. The command_pool and queue in
create_info are used for a one-shot command buffer to upload the font
texture; they are not stored.
Sourcepub fn render(
&mut self,
draw_data: &DrawData,
command_buffer: CommandBuffer,
) -> Result<(), RendererError>
pub fn render( &mut self, draw_data: &DrawData, command_buffer: CommandBuffer, ) -> Result<(), RendererError>
Record draw commands for the given imgui draw data into command_buffer.
The command buffer must already be inside a compatible render pass.
Vertex and index buffers are reallocated if the current ones are too
small; old buffers are kept alive until the next call to render()
so that any previously recorded command buffers still referencing them
can finish executing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Renderer
impl RefUnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnwindSafe for Renderer
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
Mutably borrows from an owned value. Read more