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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
// TODO: Replace all format string assign instances with write!
//#![feature(lazy_type_alias)] // This may be performance intensive
// Incomplete: specialization, generic_const_exprs, const_closures
// #![feature(const_closures)]
// #![feature(specialization)]
// #![feature(vec_try_remove)] // Miri does not recognize this feature
//#![feature(const_heap)]
//! Miners
//! Rust
//! Lib
//! Mirl (Mirl sounded better than Mrl)
//!
//! How to get started:
//! ```
//! #[cfg(test)]
//! #[cfg(not(feature = "minifb"))]
//! compile_error!("`minifb` flag needs to be set");
//!
//! use mirl::platform::windowing::traits::*;
//! fn main() {
//! let mut buffer = mirl::prelude::Buffer::new_empty((800, 600));
//! // The supported are `minifb`, `glfw`, and experimentally `console`
//! let mut window = mirl::prelude::minifb::Framework::new(
//! "Example window",
//! mirl::prelude::WindowSettings::default(&buffer),
//! )
//! .unwrap();
//! while window.is_open() {
//! buffer.clear();
//!
//! // Draw here, use mirl::render for simple presets/helper functions
//!
//! window.update(&buffer);
//! }
//! }
//! ```
//! For a debugging window lib "similar" to `Dear ImGui` you can use the `dear_mirl_gui` crate (which is `RmMode`)
//!
//! This lib has got a ton to offer but the main attractions are in here:
//! ## Window/Rendering Bundle (flags: `minifb`/`glfw`/`all_backends`):
//!
//! - [Frameworks](crate::platform::windowing::traits) - What are they capable of? (for [`crate::platform::minifb::Framework`] or [`crate::platform::glfw::Framework`])
//! - [Buffer] - The central struct many other functions rely on
//! - [Rendering](crate::render) - Render simple shapes
//! - [Platform](crate::platform) - Other neat stuff like [`crate::platform::keycodes::KeyCode`]/[`crate::platform::MouseButton`], or [`crate::platform::ScreenNormalizer`]
//! - [System interaction](crate::system::action) - Functions that are untypical for usual applications like moving the window, getting/setting the z position, or hiding a window from the taskbar
//! - [Color Stuff](crate::graphics) - What is rendering without color manipulation?
//! - [Modular File System](crate::platform::file_system::FileSystem) - A custom file system wrapper to support file accessing on web and natively
//! - [Rust functionality extension](crate::extensions) - Adding to rust what should've been there in the first place, especially tuple operations
/// Directional stuff -> NESW, N NE E SE S SW W NW
/// Stuff that should exist by default yet doesn't; use `mirl::extensions::*;` to import all of 'em
/// Stuff related to graphics -> Color manipulation
///
/// For rendering use [`mirl::render`](crate::render)
/// Math and collision focused stuff
/// Stuff I didn't know how to categorize -> Expect these objects to be moved in the future
/// Window creation/managing, file system creation/managing
///
/// For actually rendering stuff, use [`mirl::render`](crate::render)
///
/// For basic collision, use [`mirl::math::collision`](crate::math::collision)
/// Rendering stuff, simple but powerful (on [`mirl::prelude::Buffer`](crate::prelude::Buffer))
///
/// For color stuff, use [`mirl::graphics`](crate::graphics)
/// Text related stuff
/// Time related stuff
/// Terminal stuff
/// Unified os specific features
/// Functions for interacting with computers outside this one
/// Useful constants -> std contains some of these internally yet doesn't expose them for anyone else to use
/// Enables the rust traceback by setting the environment variable `RUST_BACKTRACE` to `1`
/// Enables the extended rust traceback by setting the environment variable `RUST_BACKTRACE` to `full`
/// Disables the rust traceback by setting the environment variable `RUST_BACKTRACE` to `0`
// // This little fella is so often used that it only makes sense to reexport it
pub use Buffer;
/// Defaults
/// Settings to be applied throughout the lib
/// A reexport of all available/used dependencies
// TODO:
// - Clipboard support
// - Sound support
// - Networking support?
// - (Full) Linux Compatibility
// - Compression of svg fils inside `mirl::platform::mouse::svg`:
// - Svg object deduplication using relative transformation
// - Zip for a size reduction from current ~470kb to ~90kb
// - Split files:
// - mirl::graphics
// - mirl::platform::mouse
// - mirl::extensions::math
// - mirl::system::action::windows_actions
// - key_manager and mouse_manager in mirl::platform::shared
// - Add shapes to mirl::math::geometry and add more dimension support for existing shapes
// - Resolve other `TODO` sprinkled around the lib
// - Move `mirl::extensions` into their own crate
// - Move `mirl::render` + `mirl::graphics` + `mirl::windowing` into their own crate?
// TODON'T:
// - Mac support
// Web support
// Incompatible: ahash, device_query