Struct sdl2_window::Sdl2Window [−][src]
A window implemented by SDL2 back-end.
Fields
window: Window
SDL window handle.
context: GLContext
Allow dead code because this keeps track of the OpenGL context. Will be released on drop.
sdl_context: Sdl
SDL context.
video_subsystem: VideoSubsystem
Video subsystem.
Implementations
impl Sdl2Window
[src]
pub fn new(settings: &WindowSettings) -> Result<Self, String>
[src]
Creates a new game window for SDL2. This will initialize SDL and the video subsystem.
You can retrieve both via the public fields on the Sdl2Window
struct.
pub fn with_subsystem(
video_subsystem: VideoSubsystem,
settings: &WindowSettings
) -> Result<Self, String>
[src]
video_subsystem: VideoSubsystem,
settings: &WindowSettings
) -> Result<Self, String>
Creates a window with the supplied SDL Video subsystem.
pub fn init_joysticks(&mut self) -> Result<u32, String>
[src]
Initialize the joystick subsystem. Required before joystick input events will be returned. Returns the number available or error.
Trait Implementations
impl AdvancedWindow for Sdl2Window
[src]
fn get_title(&self) -> String
[src]
fn set_title(&mut self, value: String)
[src]
fn get_exit_on_esc(&self) -> bool
[src]
fn set_exit_on_esc(&mut self, value: bool)
[src]
fn set_capture_cursor(&mut self, value: bool)
[src]
fn show(&mut self)
[src]
fn hide(&mut self)
[src]
fn get_position(&self) -> Option<Position>
[src]
fn set_position<P: Into<Position>>(&mut self, pos: P)
[src]
fn set_size<S: Into<Size>>(&mut self, size: S)
[src]
pub fn title(self, value: String) -> Self
[src]
pub fn exit_on_esc(self, value: bool) -> Self
[src]
pub fn capture_cursor(self, value: bool) -> Self
[src]
pub fn position<P>(self, val: P) -> Self where
P: Into<Position>,
[src]
P: Into<Position>,
impl BuildFromWindowSettings for Sdl2Window
[src]
fn build_from_window_settings(settings: &WindowSettings) -> Result<Self, String>
[src]
impl Drop for Sdl2Window
[src]
impl OpenGLWindow for Sdl2Window
[src]
fn get_proc_address(&mut self, proc_name: &str) -> ProcAddress
[src]
fn is_current(&self) -> bool
[src]
fn make_current(&mut self)
[src]
impl Window for Sdl2Window
[src]
fn should_close(&self) -> bool
[src]
fn set_should_close(&mut self, value: bool)
[src]
fn swap_buffers(&mut self)
[src]
fn size(&self) -> Size
[src]
fn wait_event(&mut self) -> Input
[src]
fn wait_event_timeout(&mut self, timeout: Duration) -> Option<Input>
[src]
fn poll_event(&mut self) -> Option<Input>
[src]
fn draw_size(&self) -> Size
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Sdl2Window
impl !Send for Sdl2Window
impl !Sync for Sdl2Window
impl Unpin for Sdl2Window
impl !UnwindSafe for Sdl2Window
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,