Implement iced_glutin 🎉
This commit is contained in:
parent
a1a5fcfd46
commit
e0e4ee73fe
31 changed files with 718 additions and 498 deletions
|
|
@ -6,6 +6,7 @@ use crate::{
|
|||
Vector, VerticalAlignment, Viewport,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Layer<'a> {
|
||||
pub bounds: Rectangle,
|
||||
pub quads: Vec<Quad>,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
mod compositor;
|
||||
|
||||
#[cfg(feature = "opengl")]
|
||||
mod gl_compositor;
|
||||
|
||||
pub use compositor::Compositor;
|
||||
|
||||
#[cfg(feature = "opengl")]
|
||||
pub use gl_compositor::GLCompositor;
|
||||
|
|
|
|||
24
graphics/src/window/gl_compositor.rs
Normal file
24
graphics/src/window/gl_compositor.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
use crate::{Size, Viewport};
|
||||
use iced_native::mouse;
|
||||
|
||||
use core::ffi::c_void;
|
||||
|
||||
pub trait GLCompositor: Sized {
|
||||
type Renderer: iced_native::Renderer;
|
||||
type Settings: Default;
|
||||
|
||||
unsafe fn new(
|
||||
settings: Self::Settings,
|
||||
loader_function: impl FnMut(&str) -> *const c_void,
|
||||
) -> (Self, Self::Renderer);
|
||||
|
||||
fn resize_viewport(&mut self, physical_size: Size<u32>);
|
||||
|
||||
fn draw<T: AsRef<str>>(
|
||||
&mut self,
|
||||
renderer: &mut Self::Renderer,
|
||||
viewport: &Viewport,
|
||||
output: &<Self::Renderer as iced_native::Renderer>::Output,
|
||||
overlay: &[T],
|
||||
) -> mouse::Interaction;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue