diff options
author | 2020-05-30 03:04:16 +0200 | |
---|---|---|
committer | 2020-05-30 03:04:16 +0200 | |
commit | 6cb90570a3af18b1a1ad455dc1ce5858f8446aa6 (patch) | |
tree | c58e912ef392592abfd1e05ecdada0c6b4c5e249 /glow | |
parent | 6d73b94e9ab7fd639746998a83970929437b687b (diff) | |
download | iced-6cb90570a3af18b1a1ad455dc1ce5858f8446aa6.tar.gz iced-6cb90570a3af18b1a1ad455dc1ce5858f8446aa6.tar.bz2 iced-6cb90570a3af18b1a1ad455dc1ce5858f8446aa6.zip |
Expose `Backend` in `iced_glow`
Diffstat (limited to 'glow')
-rw-r--r-- | glow/src/backend.rs | 11 | ||||
-rw-r--r-- | glow/src/lib.rs | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/glow/src/backend.rs b/glow/src/backend.rs index 6bd443ad..a54dce79 100644 --- a/glow/src/backend.rs +++ b/glow/src/backend.rs @@ -9,9 +9,10 @@ use iced_graphics::Primitive; use iced_native::mouse; use iced_native::{Font, HorizontalAlignment, Size, VerticalAlignment}; -/// A [`glow`] renderer. +/// A [`glow`] graphics backend for [`iced`]. /// /// [`glow`]: https://github.com/grovesNL/glow +/// [`iced`]: https://github.com/hecrj/iced #[derive(Debug)] pub struct Backend { quad_pipeline: quad::Pipeline, @@ -20,9 +21,9 @@ pub struct Backend { } impl Backend { - /// Creates a new [`Renderer`]. + /// Creates a new [`Backend`]. /// - /// [`Renderer`]: struct.Renderer.html + /// [`Backend`]: struct.Renderer.html pub fn new(gl: &glow::Context, settings: Settings) -> Self { let text_pipeline = text::Pipeline::new(gl, settings.default_font); let quad_pipeline = quad::Pipeline::new(gl); @@ -35,6 +36,10 @@ impl Backend { } } + /// Draws the provided primitives in the default framebuffer. + /// + /// The text provided as overlay will be rendered on top of the primitives. + /// This is useful for rendering debug information. pub fn draw<T: AsRef<str>>( &mut self, gl: &glow::Context, diff --git a/glow/src/lib.rs b/glow/src/lib.rs index c427d13a..a6c8a75a 100644 --- a/glow/src/lib.rs +++ b/glow/src/lib.rs @@ -18,9 +18,9 @@ pub mod settings; pub mod widget; pub mod window; +pub use backend::Backend; pub use settings::Settings; -pub(crate) use backend::Backend; pub(crate) use iced_graphics::Transformation; #[doc(no_inline)] |