Renderer

Struct Renderer 

Source
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

Source

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.

Source

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§

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> 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.