Screen API
Small library for screen. Changing screen size and show and hide cursor.
Structs
ExclusiveMode
struct ExclusiveMode {
frequency: Int
height: Int
id: Int
width: Int
}
Functions
Capabilities and resolutions
Querying screen exclusive modes (fullscreen).
exclusive_modes
fn exclusive_modes() -> VecLikeView<ExclusiveMode>
Return all known exclusive fullscreen modes.
has_exclusive
fn has_exclusive() -> Bool
Return true if exclusive fullscreen modes are supported. Similar to exclusive_modes().len() != 0
has_borderless
fn has_borderless() -> Bool
Return true if borderless fullscreen is supported.
has_windowed
fn has_windowed() -> Bool
Return true if windowed mode is supported.
min_windowed_extent
fn min_windowed_extent() -> (Int, Int)
Return the smallest useful windowed extent as (width, height).
max_windowed_extent
fn max_windowed_extent() -> (Int, Int)
Return the largest useful windowed extent as (width, height).
Mode selection
Setting a supported screen mode.
set_exclusive
fn set_exclusive(mode_id: Int) -> Bool
Set exclusive fullscreen using a mode id from exclusive_modes(). Returns true if successful.
set_borderless
fn set_borderless() -> Bool
Set borderless fullscreen on the current monitor. Returns true if successful.
set_windowed
fn set_windowed(width: Int, height: Int) -> Bool
Set windowed mode at an explicit extent. Returns true if successful.
Cursor
Refers to the operating system–controlled mouse pointer. Not to be confused with a text cursor (caret).
hide_cursor
fn hide_cursor()
Hides the system cursor.
show_cursor
fn show_cursor()
Shows the system cursor.