Struct Renderer

Source
pub struct Renderer {
    pub textures: Textures<Texture>,
    /* private fields */
}

Fields§

§textures: Textures<Texture>

Textures of the font atlas and all images.

Implementations§

Source§

impl Renderer

Source

pub fn new( imgui: &mut Context, device: &Device, queue: &Queue, config: RendererConfig<'_>, ) -> Self

Create an entirely new imgui wgpu renderer.

Source

pub fn prepare( &self, draw_data: &DrawData, render_data: Option<RenderData>, queue: &Queue, device: &Device, ) -> RenderData

Prepares buffers for the current imgui frame. This must be called before Renderer::split_render, and its output must be passed to the render call.

Source

pub fn split_render<'r>( &'r self, draw_data: &DrawData, render_data: &'r RenderData, rpass: &mut RenderPass<'r>, ) -> RendererResult<()>

Render the current imgui frame. Renderer::prepare must be called first, and the output render data must be kept for the lifetime of the renderpass.

Source

pub fn render<'r>( &'r mut self, draw_data: &DrawData, queue: &Queue, device: &Device, rpass: &mut RenderPass<'r>, ) -> RendererResult<()>

Render the current imgui frame.

Source

pub fn reload_font_texture( &mut self, imgui: &mut Context, device: &Device, queue: &Queue, )

Updates the texture on the GPU corresponding to the current imgui font atlas.

This has to be called after loading a font.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,