Struct VideoSubsystem
pub struct VideoSubsystem { /* private fields */ }
dep_sdl3
only.Implementations§
§impl VideoSubsystem
impl VideoSubsystem
pub fn clipboard(&self) -> ClipboardUtil
§impl VideoSubsystem
impl VideoSubsystem
pub fn text_input(&self) -> TextInputUtil
§impl VideoSubsystem
impl VideoSubsystem
§impl VideoSubsystem
impl VideoSubsystem
pub 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 window_and_renderer(
&self,
title: &str,
width: u32,
height: u32,
) -> Result<Canvas<Window>, Error> ⓘ
pub fn window_and_renderer( &self, title: &str, width: u32, height: u32, ) -> Result<Canvas<Window>, Error> ⓘ
Create a window with a renderer.
pub 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> ⓘ
pub fn displays(&self) -> Result<Vec<Display>, Error> ⓘ
pub fn get_primary_display(&self) -> Result<Display, Error> ⓘ
pub fn get_primary_display(&self) -> Result<Display, Error> ⓘ
Get primary display ID.
pub fn is_screen_saver_enabled(&self) -> bool
pub fn enable_screen_saver(&self)
pub fn disable_screen_saver(&self)
pub 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.
pub fn gl_load_library<P>(&self, path: P) -> Result<(), Error> ⓘ
pub fn gl_load_library<P>(&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.
pub 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.
pub fn gl_get_proc_address(
&self,
procname: &str,
) -> Option<unsafe extern "C" fn()> ⓘ
pub fn gl_get_proc_address( &self, procname: &str, ) -> Option<unsafe extern "C" fn()> ⓘ
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> ⓘ
pub 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>(&self, interval: S) -> Result<(), Error> ⓘwhere
S: Into<SwapInterval>,
pub fn gl_get_swap_interval(&self) -> Result<SwapInterval, Error> ⓘ
pub 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.
pub fn vulkan_load_library<P>(&self, path: P) -> Result<(), Error> ⓘ
pub fn vulkan_load_library<P>(&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.
pub 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.
pub fn vulkan_get_proc_address_function(&self) -> Option<unsafe extern "C" fn()> ⓘ
pub fn vulkan_get_proc_address_function(&self) -> Option<unsafe extern "C" fn()> ⓘ
Gets the pointer to the
vkGetInstanceProcAddr
Vulkan function. This function can be called to retrieve the address of other Vulkan
functions.
pub fn get_system_theme() -> SystemTheme
pub fn get_system_theme() -> SystemTheme
Get the current system theme.
Trait Implementations§
§impl Clone for VideoSubsystem
impl Clone for VideoSubsystem
§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§impl Debug for VideoSubsystem
impl Debug for VideoSubsystem
Auto Trait Implementations§
impl Freeze for VideoSubsystem
impl RefUnwindSafe for VideoSubsystem
impl !Send for VideoSubsystem
impl !Sync for VideoSubsystem
impl Unpin for VideoSubsystem
impl UnwindSafe for VideoSubsystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId
of Self
using a custom hasher.Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Source§fn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Source§fn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Source§fn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more