pub struct Renderer { /* private fields */ }
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn init(
ctx: &mut Context,
device: Arc<Device>,
queue: Arc<Queue>,
format: Format,
) -> Result<Renderer, Box<dyn Error>>
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.
Sourcepub fn draw_commands<I>(
&mut self,
cmd_buf_builder: &mut AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>,
_queue: Arc<Queue>,
target: I,
draw_data: &DrawData,
) -> Result<(), Box<dyn Error>>
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>>
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
Sourcepub fn reload_font_texture(
&mut self,
ctx: &mut Context,
device: Arc<Device>,
queue: Arc<Queue>,
) -> Result<(), Box<dyn Error>>
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.