diff options
author | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-09-25 18:04:55 +0200 |
---|---|---|
committer | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-10-03 09:53:37 +0200 |
commit | 8c6a27d42615fc97b1aed31c20c3aff3d25c88d4 (patch) | |
tree | 1e08975b0bbfa982ead924ac67b2c873ec55ea53 /src/lib.rs | |
parent | 9fccb2e06e15f56f270da4f7cbd5fa39b49b6826 (diff) | |
download | glutin-8c6a27d42615fc97b1aed31c20c3aff3d25c88d4.tar.gz glutin-8c6a27d42615fc97b1aed31c20c3aff3d25c88d4.zip |
Add an `os` module containing platform-specific traits
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 31 |
1 files changed, 30 insertions, 1 deletions
@@ -61,7 +61,7 @@ extern crate x11_dl; pub use events::*; pub use headless::{HeadlessRendererBuilder, HeadlessContext}; #[cfg(feature = "window")] -pub use window::{WindowBuilder, Window, WindowProxy, PollEventsIterator, WaitEventsIterator}; +pub use window::{WindowBuilder, WindowProxy, PollEventsIterator, WaitEventsIterator}; #[cfg(feature = "window")] pub use window::{AvailableMonitorsIter, MonitorId, get_available_monitors, get_primary_monitor}; #[cfg(feature = "window")] @@ -78,6 +78,35 @@ mod headless; #[cfg(feature = "window")] mod window; +pub mod os; + +/// Represents an OpenGL context and the Window or environment around it. +/// +/// # Example +/// +/// ```ignore +/// let window = Window::new().unwrap(); +/// +/// unsafe { window.make_current() }; +/// +/// loop { +/// for event in window.poll_events() { +/// match(event) { +/// // process events here +/// _ => () +/// } +/// } +/// +/// // draw everything here +/// +/// window.swap_buffers(); +/// std::old_io::timer::sleep(17); +/// } +/// ``` +pub struct Window { + window: platform::Window, +} + /// Trait that describes objects that have access to an OpenGL context. pub trait GlContext { /// Sets the context as the current context. |