Trait imgui::PlatformViewportBackend

source ·
pub trait PlatformViewportBackend: 'static {
Show 16 methods // Required methods fn create_window(&mut self, viewport: &mut Viewport); fn destroy_window(&mut self, viewport: &mut Viewport); fn show_window(&mut self, viewport: &mut Viewport); fn set_window_pos(&mut self, viewport: &mut Viewport, pos: [f32; 2]); fn get_window_pos(&mut self, viewport: &mut Viewport) -> [f32; 2]; fn set_window_size(&mut self, viewport: &mut Viewport, size: [f32; 2]); fn get_window_size(&mut self, viewport: &mut Viewport) -> [f32; 2]; fn set_window_focus(&mut self, viewport: &mut Viewport); fn get_window_focus(&mut self, viewport: &mut Viewport) -> bool; fn get_window_minimized(&mut self, viewport: &mut Viewport) -> bool; fn set_window_title(&mut self, viewport: &mut Viewport, title: &str); fn set_window_alpha(&mut self, viewport: &mut Viewport, alpha: f32); fn update_window(&mut self, viewport: &mut Viewport); fn render_window(&mut self, viewport: &mut Viewport); fn swap_buffers(&mut self, viewport: &mut Viewport); fn create_vk_surface( &mut self, viewport: &mut Viewport, instance: u64, out_surface: &mut u64 ) -> i32;
}
Expand description

Trait holding functions needed when the platform integration supports viewports.

Register it via Context::set_platform_backend()

Required Methods§

source

fn create_window(&mut self, viewport: &mut Viewport)

Called by imgui when a new Viewport is created.

§Notes

This function should initiate the creation of a platform window. The window should be invisible.

source

fn destroy_window(&mut self, viewport: &mut Viewport)

Called by imgui when a Viewport is about to be destroyed.

§Notes

This function should initiate the destruction of the platform window.

source

fn show_window(&mut self, viewport: &mut Viewport)

Called by imgui to make a Viewport visible.

source

fn set_window_pos(&mut self, viewport: &mut Viewport, pos: [f32; 2])

Called by imgui to reposition a Viewport.

§Notes

pos specifies the position of the windows content area (excluding title bar etc.)

source

fn get_window_pos(&mut self, viewport: &mut Viewport) -> [f32; 2]

Called by imgui to get the position of a Viewport.

§Notes

You should return the position of the window’s content area (excluding title bar etc.)

source

fn set_window_size(&mut self, viewport: &mut Viewport, size: [f32; 2])

Called by imgui to set the size of a Viewport.

§Notes

size specifies the size of the window’s content area (excluding title bar etc.)

source

fn get_window_size(&mut self, viewport: &mut Viewport) -> [f32; 2]

Called by imgui to get the size of a Viewport.

§Notes

you should return the size of the window’s content area (excluding title bar etc.)

source

fn set_window_focus(&mut self, viewport: &mut Viewport)

Called by imgui to make a Viewport steal the focus.

source

fn get_window_focus(&mut self, viewport: &mut Viewport) -> bool

Called by imgui to query whether a Viewport is in focus.

source

fn get_window_minimized(&mut self, viewport: &mut Viewport) -> bool

Called by imgui to query whether a Viewport is minimized.

source

fn set_window_title(&mut self, viewport: &mut Viewport, title: &str)

Called by imgui to set a Viewport title.

source

fn set_window_alpha(&mut self, viewport: &mut Viewport, alpha: f32)

Called by imgui to set the opacity of an entire Viewport.

If your backend does not support opactiy, it is safe to just do nothing in this function.

source

fn update_window(&mut self, viewport: &mut Viewport)

source

fn render_window(&mut self, viewport: &mut Viewport)

source

fn swap_buffers(&mut self, viewport: &mut Viewport)

source

fn create_vk_surface( &mut self, viewport: &mut Viewport, instance: u64, out_surface: &mut u64 ) -> i32

Implementors§