ImGuiPlatform

Trait ImGuiPlatform 

Source
pub trait ImGuiPlatform {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn init(&mut self) -> Result<(), Self::Error>;
    fn handle_event(&mut self, event: &dyn Any) -> Result<bool, Self::Error>;
    fn new_frame(&mut self) -> Result<(), Self::Error>;

    // Provided method
    fn shutdown(&mut self) -> Result<(), Self::Error> { ... }
}
Expand description

Trait for platform backends with unified error handling

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Platform-specific error type

Required Methods§

Source

fn init(&mut self) -> Result<(), Self::Error>

Initialize the platform backend

Source

fn handle_event(&mut self, event: &dyn Any) -> Result<bool, Self::Error>

Handle platform events

Source

fn new_frame(&mut self) -> Result<(), Self::Error>

Update platform state for new frame

Provided Methods§

Source

fn shutdown(&mut self) -> Result<(), Self::Error>

Clean up platform resources

Implementors§