sdl3_sys/generated/
misc.rs

1//! SDL API functions that don't fit elsewhere.
2
3use super::stdinc::*;
4
5use super::error::*;
6
7unsafe extern "C" {
8    /// Open a URL/URI in the browser or other appropriate external application.
9    ///
10    /// Open a URL in a separate, system-provided application. How this works will
11    /// vary wildly depending on the platform. This will likely launch what makes
12    /// sense to handle a specific URL's protocol (a web browser for `http://`,
13    /// etc), but it might also be able to launch file managers for directories and
14    /// other things.
15    ///
16    /// What happens when you open a URL varies wildly as well: your game window
17    /// may lose focus (and may or may not lose focus if your game was fullscreen
18    /// or grabbing input at the time). On mobile devices, your app will likely
19    /// move to the background or your process might be paused. Any given platform
20    /// may or may not handle a given URL.
21    ///
22    /// If this is unimplemented (or simply unavailable) for a platform, this will
23    /// fail with an error. A successful result does not mean the URL loaded, just
24    /// that we launched _something_ to handle it (or at least believe we did).
25    ///
26    /// All this to say: this function can be useful, but you should definitely
27    /// test it on every platform you target.
28    ///
29    /// ## Parameters
30    /// - `url`: a valid URL/URI to open. Use `file:///full/path/to/file` for
31    ///   local files, if supported.
32    ///
33    /// ## Return value
34    /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
35    ///   information.
36    ///
37    /// ## Availability
38    /// This function is available since SDL 3.2.0.
39    pub fn SDL_OpenURL(url: *const ::core::ffi::c_char) -> ::core::primitive::bool;
40}
41
42#[cfg(doc)]
43use crate::everything::*;