mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-11 05:28:35 +00:00
returned the platform io func on the docking branch
This commit is contained in:
parent
17986be68a
commit
8f636f8057
@ -23,6 +23,7 @@ parking_lot = "0.12"
|
||||
cfg-if = "1"
|
||||
|
||||
[features]
|
||||
default = ["docking"]
|
||||
wasm = ["imgui-sys/wasm"]
|
||||
freetype = ["imgui-sys/freetype"]
|
||||
docking = ["imgui-sys/docking"]
|
||||
|
||||
@ -610,6 +610,23 @@ impl Context {
|
||||
|
||||
#[cfg(feature = "docking")]
|
||||
impl Context {
|
||||
/// Returns an immutable reference to the Context's [`PlatformIo`](crate::PlatformIo) object.
|
||||
pub fn platform_io(&self) -> &crate::PlatformIo {
|
||||
unsafe {
|
||||
// safe because PlatformIo is a transparent wrapper around sys::ImGuiPlatformIO
|
||||
// and &self ensures we have shared ownership of PlatformIo.
|
||||
&*(sys::igGetPlatformIO() as *const crate::PlatformIo)
|
||||
}
|
||||
}
|
||||
/// Returns a mutable reference to the Context's [`PlatformIo`](crate::PlatformIo) object.
|
||||
pub fn platform_io_mut(&mut self) -> &mut crate::PlatformIo {
|
||||
unsafe {
|
||||
// safe because PlatformIo is a transparent wrapper around sys::ImGuiPlatformIO
|
||||
// and &mut self ensures exclusive ownership of PlatformIo.
|
||||
&mut *(sys::igGetPlatformIO() as *mut crate::PlatformIo)
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns an immutable reference to the main [`Viewport`](crate::Viewport)
|
||||
pub fn main_viewport(&self) -> &crate::Viewport {
|
||||
unsafe {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user