Struct sdl2::VideoSubsystem
source · [−]pub struct VideoSubsystem { /* private fields */ }
Implementations
sourceimpl VideoSubsystem
impl VideoSubsystem
pub fn clipboard(&self) -> ClipboardUtil
sourceimpl VideoSubsystem
impl VideoSubsystem
pub fn text_input(&self) -> TextInputUtil
sourceimpl VideoSubsystem
impl VideoSubsystem
sourceimpl VideoSubsystem
impl VideoSubsystem
sourceimpl VideoSubsystem
impl VideoSubsystem
sourcepub fn window(&self, title: &str, width: u32, height: u32) -> WindowBuilder
pub fn window(&self, title: &str, width: u32, height: u32) -> WindowBuilder
Initializes a new WindowBuilder
; a convenience method that calls WindowBuilder::new()
.
pub fn current_video_driver(&self) -> &'static str
pub fn num_video_displays(&self) -> Result<i32, String>
sourcepub fn display_name(&self, display_index: i32) -> Result<String, String>
pub fn display_name(&self, display_index: i32) -> Result<String, String>
Get the name of the display at the index display_name
.
Will return an error if the index is out of bounds or if SDL experienced a failure; inspect the returned string for further info.
pub fn display_bounds(&self, display_index: i32) -> Result<Rect, String>
pub fn display_usable_bounds(&self, display_index: i32) -> Result<Rect, String>
pub fn num_display_modes(&self, display_index: i32) -> Result<i32, String>
pub fn display_mode(
&self,
display_index: i32,
mode_index: i32
) -> Result<DisplayMode, String>
pub fn desktop_display_mode(
&self,
display_index: i32
) -> Result<DisplayMode, String>
pub fn current_display_mode(
&self,
display_index: i32
) -> Result<DisplayMode, String>
pub fn closest_display_mode(
&self,
display_index: i32,
mode: &DisplayMode
) -> Result<DisplayMode, String>
sourcepub fn display_dpi(&self, display_index: i32) -> Result<(f32, f32, f32), String>
pub fn display_dpi(&self, display_index: i32) -> Result<(f32, f32, f32), String>
Return a triplet (ddpi, hdpi, vdpi)
containing the diagonal, horizontal and vertical
dots/pixels-per-inch of a display
sourcepub fn display_orientation(&self, display_index: i32) -> Orientation
pub fn display_orientation(&self, display_index: i32) -> Orientation
Return orientation of a display or Unknown if orientation could not be determined.
pub fn is_screen_saver_enabled(&self) -> bool
pub fn enable_screen_saver(&self)
pub fn disable_screen_saver(&self)
sourcepub fn gl_load_library_default(&self) -> Result<(), String>
pub fn gl_load_library_default(&self) -> Result<(), String>
Loads the default OpenGL library.
This should be done after initializing the video driver, but before creating any OpenGL windows. If no OpenGL library is loaded, the default library will be loaded upon creation of the first OpenGL window.
If a different library is already loaded, this function will return an error.
sourcepub fn gl_load_library<P: AsRef<Path>>(&self, path: P) -> Result<(), String>
pub fn gl_load_library<P: AsRef<Path>>(&self, path: P) -> Result<(), String>
Loads the OpenGL library using a platform-dependent OpenGL library name (usually a file path).
This should be done after initializing the video driver, but before creating any OpenGL windows. If no OpenGL library is loaded, the default library will be loaded upon creation of the first OpenGL window.
If a different library is already loaded, this function will return an error.
sourcepub fn gl_unload_library(&self)
pub fn gl_unload_library(&self)
Unloads the current OpenGL library.
To completely unload the library, this should be called for every successful load of the OpenGL library.
sourcepub fn gl_get_proc_address(&self, procname: &str) -> *const ()
pub fn gl_get_proc_address(&self, procname: &str) -> *const ()
Gets the pointer to the named OpenGL function.
This is useful for OpenGL wrappers such as gl-rs
.
pub fn gl_extension_supported(&self, extension: &str) -> bool
pub fn gl_get_current_window_id(&self) -> Result<u32, String>
sourcepub fn gl_release_current_context(&self) -> Result<(), String>
pub fn gl_release_current_context(&self) -> Result<(), String>
Releases the thread’s current OpenGL context, i.e. sets the current OpenGL context to nothing.
pub fn gl_set_swap_interval<S: Into<SwapInterval>>(
&self,
interval: S
) -> Result<(), String>
pub fn gl_get_swap_interval(&self) -> SwapInterval
sourcepub fn vulkan_load_library_default(&self) -> Result<(), String>
pub fn vulkan_load_library_default(&self) -> Result<(), String>
Loads the default Vulkan library.
This should be done after initializing the video driver, but before creating any Vulkan windows. If no Vulkan library is loaded, the default library will be loaded upon creation of the first Vulkan window.
If a different library is already loaded, this function will return an error.
sourcepub fn vulkan_load_library<P: AsRef<Path>>(&self, path: P) -> Result<(), String>
pub fn vulkan_load_library<P: AsRef<Path>>(&self, path: P) -> Result<(), String>
Loads the Vulkan library using a platform-dependent Vulkan library name (usually a file path).
This should be done after initializing the video driver, but before creating any Vulkan windows. If no Vulkan library is loaded, the default library will be loaded upon creation of the first Vulkan window.
If a different library is already loaded, this function will return an error.
sourcepub fn vulkan_unload_library(&self)
pub fn vulkan_unload_library(&self)
Unloads the current Vulkan library.
To completely unload the library, this should be called for every successful load of the Vulkan library.
sourcepub fn vulkan_get_proc_address_function(&self) -> Result<*const (), String>
pub fn vulkan_get_proc_address_function(&self) -> Result<*const (), String>
Gets the pointer to the
vkGetInstanceProcAddr
Vulkan function. This function can be called to retrieve the address of other Vulkan
functions.
Trait Implementations
sourceimpl Clone for VideoSubsystem
impl Clone for VideoSubsystem
sourcefn clone(&self) -> VideoSubsystem
fn clone(&self) -> VideoSubsystem
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for VideoSubsystem
impl !Send for VideoSubsystem
impl !Sync for VideoSubsystem
impl Unpin for VideoSubsystem
impl UnwindSafe for VideoSubsystem
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more