summaryrefslogtreecommitdiffstats
path: root/winit
diff options
context:
space:
mode:
Diffstat (limited to 'winit')
-rw-r--r--winit/src/application.rs12
-rw-r--r--winit/src/settings/mod.rs15
2 files changed, 22 insertions, 5 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs
index a8612b1a..02fa3780 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -1,5 +1,5 @@
use crate::{
- conversion,
+ container, conversion,
input::{keyboard, mouse},
renderer::{Target, Windowed},
subscription, Cache, Clipboard, Command, Container, Debug, Element, Event,
@@ -18,7 +18,7 @@ pub trait Application: Sized {
/// The renderer to use to draw the [`Application`].
///
/// [`Application`]: trait.Application.html
- type Renderer: Windowed;
+ type Renderer: Windowed + container::Renderer;
/// The type of __messages__ your [`Application`] will produce.
///
@@ -279,8 +279,12 @@ pub trait Application: Sized {
resized = false;
}
- let new_mouse_cursor =
- renderer.draw(&primitive, &debug.overlay(), &mut target);
+ let new_mouse_cursor = renderer.draw(
+ settings.background,
+ &primitive,
+ &debug.overlay(),
+ &mut target,
+ );
debug.render_finished();
diff --git a/winit/src/settings/mod.rs b/winit/src/settings/mod.rs
index 58e3d879..0384df32 100644
--- a/winit/src/settings/mod.rs
+++ b/winit/src/settings/mod.rs
@@ -1,4 +1,5 @@
//! Configure your application.
+use crate::Color;
#[cfg(target_os = "windows")]
#[path = "windows.rs"]
@@ -10,12 +11,24 @@ mod platform;
pub use platform::PlatformSpecific;
/// The settings of an application.
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
+#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Settings {
/// The [`Window`] settings
///
/// [`Window`]: struct.Window.html
pub window: Window,
+
+ /// The default background color of the application
+ pub background: Color,
+}
+
+impl Default for Settings {
+ fn default() -> Settings {
+ Settings {
+ window: Window::default(),
+ background: Color::WHITE,
+ }
+ }
}
/// The window settings of an application.