pub struct SDL2Backend {
    pub sdl_context: Sdl,
    pub event_pump: EventPump,
    pub window: Window,
    pub size_physical_pixels: [u32; 2],
    pub scale: [f32; 2],
    pub cursor_pos_physical_pixels: [f32; 2],
    pub raw_input: RawInput,
    pub frame_events: Vec<Event>,
    pub gl_context: Option<GLContext>,
    pub latest_resize_event: bool,
    pub should_close: bool,
    pub backend_settings: BackendSettings,
}

Fields

sdl_context: Sdlevent_pump: EventPumpwindow: Windowsize_physical_pixels: [u32; 2]scale: [f32; 2]cursor_pos_physical_pixels: [f32; 2]raw_input: RawInputframe_events: Vec<Event>gl_context: Option<GLContext>latest_resize_event: boolshould_close: boolbackend_settings: BackendSettings

Implementations

Trait Implementations

Swaps buffers (swapchain) when we are using double buffering (99% of the time, double buffering is the default) this also flushes the opengl commands and blocks until the swapchain image is presented IF vsync is enabled. Read more

get openGL function addresses.

This will be WindowBackend’s configuration. if necessary, just add Boxed closures as its fields and run them before window creation, after window creation etc.. to provide maximum configurability to users Read more

Create a new window backend. and return info needed for the GfxBackend creation and rendering config is the custom configuration of a specific window backend Read more

This frame’s events gather into rawinput and to be presented to egui’s context

Run the event loop. different backends run it differently, so they all need to take care and call the Gfx or UserApp functions at the right time. Read more

sometimes, the frame buffer size might have changed and the event is still not received. in those cases, wgpu / vulkan like render apis will throw an error if you try to acquire swapchain image with an outdated size. you will need to provide the latest size for succesful creation of surface frame. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.