Struct sdl2_mt::Sdl2Mt
[−]
[src]
pub struct Sdl2Mt(_);
Methods
impl Sdl2Mt
[src]
fn create_simple_window<IntoString: Into<String>>(
&self,
name: IntoString,
width: u32,
height: u32
) -> Result<u32, UiThreadExited>
&self,
name: IntoString,
width: u32,
height: u32
) -> Result<u32, UiThreadExited>
A quick, simple way to create a window. Just give it a name, width, and height.
This function executes synchronously. It will block until the window_creator function has completed.
Panics
This function will panic if the Window or the Canvas build()
functions
do not succeed.
fn create_window(
&self,
window_creator: Box<FnMut(&mut Sdl, &mut VideoSubsystem) -> Option<WindowCanvas> + Send>
) -> Result<Option<u32>, UiThreadExited>
&self,
window_creator: Box<FnMut(&mut Sdl, &mut VideoSubsystem) -> Option<WindowCanvas> + Send>
) -> Result<Option<u32>, UiThreadExited>
Executes a window_creator function that accepts &mut VideoSubsystem
and returns an Option
This function executes synchronously. It will block until the window_creator function has completed.
fn run_on_ui_thread(
&self,
lambda: Box<FnMut(&mut Sdl, &mut HashMap<u32, WindowCanvas>) + Send>
) -> Result<(), UiThreadExited>
&self,
lambda: Box<FnMut(&mut Sdl, &mut HashMap<u32, WindowCanvas>) + Send>
) -> Result<(), UiThreadExited>
This function executes asynchronously. It will not block the calling thread.
fn handle_ui_events(
&self,
event_handler: Box<FnMut(&mut Sdl, &mut HashMap<u32, WindowCanvas>, &Event) -> bool + Send>
) -> Result<(), UiThreadExited>
&self,
event_handler: Box<FnMut(&mut Sdl, &mut HashMap<u32, WindowCanvas>, &Event) -> bool + Send>
) -> Result<(), UiThreadExited>
Executes an event_handler function.
This function executes synchronously. It will block until the event_handler function has completed.
fn exit(self) -> Result<(), UiThreadExited>
Terminates the UI thread. Not strictly necessary if the program will exit anyways, such as when the main program thread returns from main.
Trait Implementations
impl Clone for Sdl2Mt
[src]
fn clone(&self) -> Sdl2Mt
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more