Struct egui_window_sdl2::SDL2Backend
source · [−]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: Sdl
event_pump: EventPump
window: Window
size_physical_pixels: [u32; 2]
scale: [f32; 2]
cursor_pos_physical_pixels: [f32; 2]
raw_input: RawInput
frame_events: Vec<Event>
gl_context: Option<GLContext>
latest_resize_event: bool
should_close: bool
backend_settings: BackendSettings
Implementations
sourceimpl SDL2Backend
impl SDL2Backend
Trait Implementations
sourceimpl HasRawWindowHandle for SDL2Backend
impl HasRawWindowHandle for SDL2Backend
fn raw_window_handle(&self) -> RawWindowHandle
sourceimpl OpenGLWindowContext for SDL2Backend
impl OpenGLWindowContext for SDL2Backend
sourcefn swap_buffers(&mut self)
fn swap_buffers(&mut self)
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
sourcefn get_proc_address(&mut self, symbol: &str) -> *const c_void
fn get_proc_address(&mut self, symbol: &str) -> *const c_void
get openGL function addresses.
sourceimpl WindowBackend for SDL2Backend
impl WindowBackend for SDL2Backend
type Configuration = SDL2Settings
type Configuration = SDL2Settings
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
sourcefn new(_config: Self::Configuration, backend_settings: BackendSettings) -> Selfwhere
Self: Sized,
fn new(_config: Self::Configuration, backend_settings: BackendSettings) -> Selfwhere
Self: Sized,
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
sourcefn take_raw_input(&mut self) -> RawInput
fn take_raw_input(&mut self) -> RawInput
This frame’s events gather into rawinput and to be presented to egui’s context
sourcefn run_event_loop<G: GfxBackend<Self>, U: UserApp<Self, G>>(
self,
gfx_backend: G,
user_app: U
)
fn run_event_loop<G: GfxBackend<Self>, U: UserApp<Self, G>>(
self,
gfx_backend: G,
user_app: U
)
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
sourcefn get_live_physical_size_framebuffer(&mut self) -> [u32; 2]
fn get_live_physical_size_framebuffer(&mut self) -> [u32; 2]
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
fn get_settings(&self) -> &BackendSettings
Auto Trait Implementations
impl RefUnwindSafe for SDL2Backend
impl !Send for SDL2Backend
impl !Sync for SDL2Backend
impl Unpin for SDL2Backend
impl UnwindSafe for SDL2Backend
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more