[][src]Struct imgui_rs_vulkan_renderer::Renderer

pub struct Renderer { /* fields omitted */ }

Vulkan renderer for imgui.

It records rendering command to the provided command buffer at each call to cmd_draw. When done with the renderer you should call destroy before droping it to release all Vulkan resources held by the renderer.

All methods take a reference to a type implementing the RendererVkContext trait.

The renderer holds a set of vertex/index buffers per in flight frames. Vertex and index buffers are resized at each call to cmd_draw if draw data does not fit.

Methods

impl Renderer[src]

pub fn new<C: RendererVkContext>(
    vk_context: &C,
    in_flight_frames: usize,
    render_pass: RenderPass,
    imgui: &mut Context
) -> RendererResult<Self>
[src]

Initialize and return a new instance of the renderer.

At initialization all Vulkan resources are initialized and font texture is created and uploaded to the gpu. Vertex and index buffers are not created yet.

Arguments

  • vk_context - A reference to a type implementing the RendererVkContext trait.
  • in_flight_frames - The number of in flight frames of the application.
  • render_pass - The render pass used to render the gui.
  • imgui - The imgui context.

Errors

  • RendererError - If the number of in flight frame in incorrect.
  • RendererError - If any Vulkan or io error is encountered during initialization.

pub fn cmd_draw<C: RendererVkContext>(
    &mut self,
    vk_context: &C,
    command_buffer: CommandBuffer,
    draw_data: &DrawData
) -> RendererResult<()>
[src]

Record commands required to render the gui.RendererError.

Arguments

  • vk_context - A reference to a type implementing the RendererVkContext trait.
  • command_buffer - The Vulkan command buffer that command will be recorded to.
  • draw_data - A reference to the imgui DrawData containing rendering data.

Errors

pub fn destroy<C: RendererVkContext>(
    &mut self,
    context: &C
) -> RendererResult<()>
[src]

Destroy Vulkan resources held by the renderer.

Arguments

Errors

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.