1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
//! # DGEWS
//!
//! DGEWS is a multithreaded toy windowing system for learning win32 api in rust lang.
//! # Example
//!
//! ```rust,ignore
//! extern crate dgews;
//! use dgews::prelude::*; // prelude module contains everything
//!
//! fn main() {
//! let mut manager = Manager::new(WindowBuilder::default()
//! .with_title("DGEWS Window")
//! .with_dimensions(800, 640)
//! .with_theme(Theme::Dark));
//!
//! manager.run(|events, control_flow, manager| {
//! match events {
//! Events::WindowEvent { id, event } => match event {
//! WindowEvents::Create => println!("[INFO]: a new window with id: {} has been created", manager.window().get_id()),
//!
//! WindowEvents::Close => {
//! println!("[INFO]: a window with id: {} has been closed", manager.window().get_id());
//! *control_flow => ControlFlow::Exit; // to exit with panicing, use ControlFlow::ExitWithCode(<your number>) instead.
//! },
//!
//! _=> {}
//! },
//!
//! Events::MouseEvent { id, event } => match event {
//! MouseEvents::MouseMove { x, y, last_x, last_y, dx, dy } => {
//! println!("[INFO]: mouse moved in the window with id {}: x={}, y={}, last_x={}, last_y={} dx={} dy={};", manager.window().get_id(), x, y, last_x, last_y, dx, dy);
//! },
//!
//! _=> {}
//! }
//!
//! _=> *control_flow = ControlFlow::Continue,
//! }
//!
//! if manager.get_key(Key::ESCAPE) == Action::Release {
//! println!("[INFO]: program is exiting");
//! *control_flow = ControlFlow::Exit;
//! }
//! });
//! }
//! ```
pub(crate) mod keyboard;
pub(crate) mod keystates;
pub(crate) mod mouse;
pub mod common;
pub mod controlflow;
pub mod events;
pub mod keycodes;
pub mod manager;
pub mod timer;
pub mod window;
pub mod windowbuilder;
pub mod prelude {
pub(crate) use super::keyboard::*;
pub(crate) use super::keystates::*;
pub(crate) use super::mouse::*;
pub use super::common::*;
pub use super::controlflow::*;
pub use super::events::*;
pub use super::keycodes::*;
pub use super::manager::*;
pub use super::timer::*;
pub use super::window::*;
pub use super::windowbuilder::*;
}