pub struct VideoSubsystem { /* private fields */ }
Implementations§
Source§impl VideoSubsystem
impl VideoSubsystem
pub fn clipboard(&self) -> ClipboardUtil
Source§impl VideoSubsystem
impl VideoSubsystem
pub fn text_input(&self) -> TextInputUtil
Source§impl 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()
.
Sourcepub fn window_and_renderer(
&self,
title: &str,
width: u32,
height: u32,
) -> Result<WindowCanvas, Error>
pub fn window_and_renderer( &self, title: &str, width: u32, height: u32, ) -> Result<WindowCanvas, Error>
Create a window with a renderer.
Sourcepub unsafe fn popup_window(
&self,
window: &Window,
width: u32,
height: u32,
) -> PopupWindowBuilder
pub unsafe fn popup_window( &self, window: &Window, width: u32, height: u32, ) -> PopupWindowBuilder
Initializes a new PopupWindowBuilder
; a convenience method that calls PopupWindowBuilder::new()
.
pub fn current_video_driver(&self) -> &'static str
pub fn num_video_drivers(&self) -> Result<i32, Error>
Sourcepub fn display_name(&self, display_index: u32) -> Result<String, Error>
pub fn display_name(&self, display_index: u32) -> Result<String, Error>
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: u32) -> Result<Rect, Error>
pub fn display_usable_bounds(&self, display_index: u32) -> Result<Rect, Error>
pub fn display_modes( &self, display_id: SDL_DisplayID, ) -> Result<Vec<DisplayMode>, Error>
pub fn desktop_display_mode( &self, display_index: u32, ) -> Result<DisplayMode, Error>
Sourcepub fn get_primary_display_id(&self) -> SDL_DisplayID
pub fn get_primary_display_id(&self) -> SDL_DisplayID
Get primary display ID.
pub fn current_display_mode( &self, display_index: u32, ) -> Result<DisplayMode, Error>
pub fn closest_display_mode( &self, display_index: u32, mode: &DisplayMode, include_high_density_modes: bool, ) -> Result<DisplayMode, Error>
Sourcepub fn display_orientation(&self, display_index: u32) -> SDL_DisplayOrientation
pub fn display_orientation(&self, display_index: u32) -> SDL_DisplayOrientation
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<(), Error>
pub fn gl_load_library_default(&self) -> Result<(), Error>
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<(), Error>
pub fn gl_load_library<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
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) -> SDL_FunctionPointer
pub fn gl_get_proc_address(&self, procname: &str) -> SDL_FunctionPointer
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, Error>
Sourcepub fn gl_release_current_context(&self) -> Result<(), Error>
pub fn gl_release_current_context(&self) -> Result<(), Error>
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<(), Error>
pub fn gl_get_swap_interval(&self) -> Result<SwapInterval, Error>
Sourcepub fn vulkan_load_library_default(&self) -> Result<(), Error>
pub fn vulkan_load_library_default(&self) -> Result<(), Error>
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<(), Error>
pub fn vulkan_load_library<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
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) -> SDL_FunctionPointer
pub fn vulkan_get_proc_address_function(&self) -> SDL_FunctionPointer
Gets the pointer to the
vkGetInstanceProcAddr
Vulkan function. This function can be called to retrieve the address of other Vulkan
functions.
Trait Implementations§
Source§impl Clone for VideoSubsystem
impl Clone for VideoSubsystem
Source§fn clone(&self) -> VideoSubsystem
fn clone(&self) -> VideoSubsystem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more