Add WindowId type

This commit is contained in:
Pierre Krieger 2017-02-03 09:13:11 +01:00
parent 9cd0430ec7
commit b988c174fe
4 changed files with 20 additions and 6 deletions

View file

@ -161,6 +161,15 @@ pub struct Window {
window: platform::Window2,
}
/// Identifier of a window. Unique for each window.
///
/// Can be obtained with `window.id()`.
///
/// Whenever you receive an event specific to a window, this event contains a `WindowId` which you
/// can then compare to the ids of your windows.
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct WindowId(platform::WindowId);
/// Provides a way to retreive events from the windows that were registered to it.
// TODO: document usage in multiple threads
pub struct EventsLoop {