Expand description
Miners Rust Lib Mirl (Mirl sounded better than Mrl)
How to get started:
use mirl::platform::framework_traits::Window;
fn main() {
let buffer = mirl::platform::Buffer::new_empty(800, 600);
let mut window = mirl::platform::minifb::Framework::new(
"Example window",
mirl::platform::WindowSettings::default(&buffer),
);
while window.is_open() {
buffer.clear();
window.update(&buffer)
}
}For a debugging window like Dear ImGui you can use dear_mirl_gui crate
This lib has got a ton to offer but the main attractions are in here:
§Window/Rendering Bundle (flags: minifb_backend/glfw_backend/full_backend_support):
- Frameworks - 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 - Render simple shapes
- Platform - Other neat stuff like [
crate::platform::keycodes::KeyCode]/crate::platform::MouseButton, orcrate::platform::ScreenNormalizer - System interaction - 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 - What is rendering without color manipulation?
- Modular File System - A custom file system wrapper to support file accessing on web and natively
- Rust functionality extension - Adding to rust what should’ve been there in the first place, especially tuple operations
Re-exports§
pub use platform::Buffer;
Modules§
- console
- Terminal stuff
- constants
- Useful constants -> std contains some of these internally yet doesn’t expose them for anyone else to use
- directions
- Directional stuff -> NESW, N NE E SE S SW W NW
- extensions
- Stuff that should exist by default yet doesn’t; use
mirl::extensions::*;to import all of ’em - graphics
- Stuff related to graphics -> Color manipulation
- math
- Math and collision focused stuff
- misc
- Stuff I didn’t know how to categorize -> Expect these objects to be moved in the future
- platform
- Window creation/managing, file system creation/managing
- render
- Rendering stuff, simple but powerful (on
mirl::platform::Buffer) - time
- Time related stuff
Macros§
- compile_
warn - Create a compile time warning using deprecation
- signed_
to_ unsigned - Converts signed types to their unsigned versions
- switch_
signing - Switches between unsigned and signed versions
- u1
- Convert a number into a u1
- u2
- Convert a number into a u2
- u4
- Convert a number into a u4
- unsigned_
to_ signed - Converts unsigned types to their signed versions
- upgrade_
type - Gives the next bigger value type excluding usize/isize
Functions§
- disable_
traceback - Disables the rust traceback by setting the environment variable
RUST_BACKTRACEto0 - enable_
traceback - Enables the rust traceback by setting the environment variable
RUST_BACKTRACEto1 - enable_
traceback_ detailed - Enables the extended rust traceback by setting the environment variable
RUST_BACKTRACEtoFULL