azul_glutin/platform/mod.rs
1//! Contains traits with platform-specific methods in them.
2//!
3//! Contains the following modules:
4//!
5//! - `android`
6//! - `ios`
7//! - `macos`
8//! - `unix`
9//! - `windows`
10
11/// Platform-specific methods for android.
12pub mod android;
13/// Platform-specific methods for iOS.
14pub mod ios;
15/// Platform-specific methods for macOS.
16pub mod macos;
17/// Platform-specific methods for unix operating systems.
18pub mod unix;
19/// Platform-specific methods for Windows.
20pub mod windows;
21/// Platform-specific methods for event loops independent from the application
22/// lifetime.
23pub mod run_return {
24 #![cfg(any(
25 target_os = "windows",
26 target_os = "macos",
27 target_os = "linux",
28 target_os = "dragonfly",
29 target_os = "freebsd",
30 target_os = "netbsd",
31 target_os = "openbsd",
32 target_os = "android",
33 ))]
34 pub use winit::platform::run_return::*;
35}
36
37use std::os::raw;
38
39/// Platform-specific extensions for OpenGL [`Context`]s.
40///
41/// [`Context`]: ../struct.Context.html
42pub trait ContextTraitExt {
43 /// Raw context handle.
44 type Handle;
45
46 /// Returns the raw context handle.
47 unsafe fn raw_handle(&self) -> Self::Handle;
48
49 /// Returns a pointer to the `EGLDisplay` object of EGL that is used by this
50 /// context.
51 ///
52 /// Return `None` if the context doesn't use EGL.
53 // The pointer will become invalid when the context is destroyed.
54 unsafe fn get_egl_display(&self) -> Option<*const raw::c_void>;
55}