Struct egui_winit_ash_integration::Integration
source · pub struct Integration<A: AllocatorTrait> { /* private fields */ }
Expand description
egui integration with winit and ash.
Implementations§
source§impl<A: AllocatorTrait> Integration<A>
impl<A: AllocatorTrait> Integration<A>
sourcepub fn new<T>(
event_loop: &EventLoop<T>,
physical_width: u32,
physical_height: u32,
scale_factor: f64,
font_definitions: FontDefinitions,
style: Style,
device: Device,
allocator: A,
qfi: u32,
queue: Queue,
swapchain_loader: Swapchain,
swapchain: SwapchainKHR,
surface_format: SurfaceFormatKHR
) -> Self
pub fn new<T>(
event_loop: &EventLoop<T>,
physical_width: u32,
physical_height: u32,
scale_factor: f64,
font_definitions: FontDefinitions,
style: Style,
device: Device,
allocator: A,
qfi: u32,
queue: Queue,
swapchain_loader: Swapchain,
swapchain: SwapchainKHR,
surface_format: SurfaceFormatKHR
) -> Self
Create an instance of the integration.
sourcepub fn handle_event(&mut self, winit_event: &WindowEvent<'_>) -> EventResponse
pub fn handle_event(&mut self, winit_event: &WindowEvent<'_>) -> EventResponse
handling winit event.
sourcepub fn begin_frame(&mut self, window: &Window)
pub fn begin_frame(&mut self, window: &Window)
begin frame.
sourcepub fn end_frame(&mut self, window: &Window) -> FullOutput
pub fn end_frame(&mut self, window: &Window) -> FullOutput
end frame.
sourcepub fn context(&self) -> Context
pub fn context(&self) -> Context
Get egui::Context
.
sourcepub fn paint(
&mut self,
command_buffer: CommandBuffer,
swapchain_image_index: usize,
clipped_meshes: Vec<ClippedPrimitive>,
textures_delta: TexturesDelta
)
pub fn paint(
&mut self,
command_buffer: CommandBuffer,
swapchain_image_index: usize,
clipped_meshes: Vec<ClippedPrimitive>,
textures_delta: TexturesDelta
)
Record paint commands.
sourcepub fn update_swapchain(
&mut self,
physical_width: u32,
physical_height: u32,
swapchain: SwapchainKHR,
surface_format: SurfaceFormatKHR
)
pub fn update_swapchain(
&mut self,
physical_width: u32,
physical_height: u32,
swapchain: SwapchainKHR,
surface_format: SurfaceFormatKHR
)
Update swapchain.
sourcepub fn register_user_texture(
&mut self,
image_view: ImageView,
sampler: Sampler
) -> TextureId
pub fn register_user_texture(
&mut self,
image_view: ImageView,
sampler: Sampler
) -> TextureId
Registering user texture.
Pass the Vulkan ImageView and Sampler.
image_view
’s image layout must be SHADER_READ_ONLY_OPTIMAL
.
UserTexture needs to be unregistered when it is no longer needed.
Example
cargo run --example user_texture
sourcepub fn unregister_user_texture(&mut self, texture_id: TextureId)
pub fn unregister_user_texture(&mut self, texture_id: TextureId)
Unregister user texture.
The internal texture (egui::TextureId::Egui) cannot be unregistered.