Renderer

Struct Renderer 

Source
pub struct Renderer { /* private fields */ }

Implementations§

Source§

impl Renderer

Source

pub fn init( ctx: &mut Context, device: Arc<Device>, queue: Arc<Queue>, format: Format, ) -> Result<Renderer, Box<dyn Error>>

Initialize the renderer object, including vertex buffers, ImGui font textures, and the Vulkan graphics pipeline.


ctx: the ImGui Context object

device: the Vulkano Device object for the device you want to render the UI on.

queue: the Vulkano Queue object for the queue the font atlas texture will be created on.

format: the Vulkano Format that the render pass will use when storing the frame in the target image.

Source

pub fn draw_commands<I>( &mut self, cmd_buf_builder: &mut AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>, _queue: Arc<Queue>, target: I, draw_data: &DrawData, ) -> Result<(), Box<dyn Error>>
where I: ImageViewAbstract + Send + Sync + 'static,

Appends the draw commands for the UI frame to an AutoCommandBufferBuilder.


cmd_buf_builder: An AutoCommandBufferBuilder from vulkano to add commands to

device: the Vulkano Device object for the device you want to render the UI on

queue: the Vulkano Queue object for buffer creation

target: the target image to render to

draw_data: the ImGui DrawData that each UI frame creates

Source

pub fn reload_font_texture( &mut self, ctx: &mut Context, device: Arc<Device>, queue: Arc<Queue>, ) -> Result<(), Box<dyn Error>>

Update the ImGui font atlas texture.


ctx: the ImGui Context object

device: the Vulkano Device object for the device you want to render the UI on.

queue: the Vulkano Queue object for the queue the font atlas texture will be created on.

Source

pub fn textures(&mut self) -> &mut Textures<Texture>

Get the texture library that the renderer uses

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> Content for T

Source§

fn ref_from_ptr<'a>(ptr: *mut c_void, size: usize) -> Option<*mut T>

Builds a pointer to this type from a raw pointer.
Source§

fn is_size_suitable(size: usize) -> bool

Returns true if the size is suitable to store a type like this.
Source§

fn indiv_size() -> usize

Returns the size of an individual element.
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.