pub struct Renderer { /* private fields */ }
Expand description
Renderer backend for imgui using SDL3 GPU.
This renderer performs the following tasks:
- Initializes a pipeline with blending suitable for ImGui
- Uploads the ImGui font atlas as a GPU texture
- Creates GPU buffers every frame for ImGui vertex/index data
- Issues draw calls using ImGui’s draw list
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn new(
device: &Device,
window: &Window,
imgui_context: &mut Context,
) -> Result<Self, Box<dyn Error>>
pub fn new( device: &Device, window: &Window, imgui_context: &mut Context, ) -> Result<Self, Box<dyn Error>>
Creates a new ImGui SDL3 renderer.
This function builds a graphics pipeline from SPIR-V vertex/fragment shaders,
configures the vertex input state to match DrawVert
, and uploads the ImGui font atlas.
Sourcepub fn render(
&mut self,
device: &Device,
command_buffer: &mut CommandBuffer,
color_targets: &[ColorTargetInfo],
imgui_context: &mut Context,
) -> Result<(), Box<dyn Error>>
pub fn render( &mut self, device: &Device, command_buffer: &mut CommandBuffer, color_targets: &[ColorTargetInfo], imgui_context: &mut Context, ) -> Result<(), Box<dyn Error>>
Renders the current ImGui draw data into the window.
This function:
- Builds and submits GPU buffers from draw data
- Sets an orthographic projection matrix
- Issues indexed draw calls
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