The Roguelike Toolkit (RLTK), implemented for Rust.


Welcome to bracket-lib

You can read a tutorial series on writing a Roguelike with this library at:

Bracket-lib is the primary support library for my book, Hands-on Rust. Please consider checking out my book.

Early work has begun on writing a manual. You can find it in the manual folder, or read it online.

BREAKING CHANGE ALERT: The crossterm feature is now cross_term if you are using bracket-terminal directly. It's still crossterm for bracket-lib and rltk.

IMPORTANT: If you are running the webgpu backend, you need to add resolver = 2 to your Cargo.toml file. WGPU requires it for platform selection.

What happened to RLTK?

This is RLTK, renamed because it is increasingly finding usage outside of just Roguelikes. It's also been divided into a number of crates, to make it easy to pick-and-choose the features you need.

  • rltk crate wraps bracket-lib and re-exports in the rltk:: and rltk::prelude namespace. This preserves compatibility with all existing RLTK projects.
  • bracket-algorithm-traits exposes the traits required for the various algorithm systems in other crates.
  • bracket-color is my RGB/HSV color management system.
  • bracket-geometry exposes various geometric primitives and helpers. Supports other crates.
  • bracket-noise is a port of Auburn's FastNoise to Rust.
  • bracket-pathfinding provides a high-performance A* (A-Star) pathing system, as well as Dijkstra maps.
  • bracket-random is a dice-oriented random number generator, including parsing of RPG-style dice strings such as 3d6+12.

Using bracket-lib

In your Cargo.toml file, include:

bracket-lib = "0.7"

Feature Flags

There are a few feature flags designed to aide integration with other systems:

  • specs tells various bracket-lib sub-systems to export important primitives as having Specs' Component type applied.
  • serde tells various bracket-lib sub-systems to support using Serde for serialization/de-serialization.


  • threaded enables multi-threading on some sub-systems.

Terminal mode:

By default, bracket-lib runs in OpenGL mode (or WebGL if it detects that you are compiling for wasm32-unknown-unknown). If you want to use other rendering back-ends, disable default features and apply one of the following feature flags:

  • webgpu to use the wgpu system as a back-end, supporting Vulkan, Metal and WebGPU.
  • crossterm to use the excellent Crossterm terminal library.
  • curses to use pancurses for ncurses or pdcurses support depending upon your platform.

Sample Projects

  • switching font

    switching font

    I'm trying to port this doryen-rs example to bracket-lib. A few versions ago I was able to do it with this code :

    self.cur_font = ctx.register_font(font).unwrap();
    ctx.consoles[ctx.active_console].font_index = self.cur_font;

    but the consoles field is now private (which is a good thing). Is there a way to change the font index of a console or do I have to register a new console, but in that case how can I get rid of the previous console ?

    opened by jice-nospam 45
  • Rltk::mouse_pos() is incorrect with HiDPI

    Rltk::mouse_pos() is incorrect with HiDPI

    I'm using version 0.5.15 and is calling Rltk::set_bg with Rltk::mouse_pos() as position. At first this follows the mouse pointer, but after I resize the window the mouse_pos position is no longer translated to the right position in console coordinate space.

    bug awaiting_confirmation 
    opened by bofh69 37
  • High CPU usage on Mac

    High CPU usage on Mac

    Looks like on Mac my game is running the main loop as fast as it can. What can I do about it? How can I help to diagnose it? Ideally, it should only redraw in response to keyboard and, optionally, mouse events.

    opened by singalen 28
  • Latest git not building for wasm

    Latest git not building for wasm

    I have this in my cargo.lock:

    version = "0.8.1"
    source = "git+"
    dependencies = [

    When I try to build for wasm, I get:

    $ cargo build --release --target wasm32-unknown-unknown
       Compiling ctrlc v3.1.7
       Compiling paste v1.0.4
       Compiling downcast-rs v1.2.0
       Compiling ucd-trie v0.1.3
       Compiling unicode-segmentation v1.7.1
       Compiling proc-macro2 v1.0.24
       Compiling syn v1.0.60
       Compiling log v0.4.14
    error[E0432]: unresolved import `platform::Signal`
      --> /Users/vsergiienko/.cargo/registry/src/
    53 | pub use platform::Signal;
       |         ^^^^^^^^^^^^^^^^ no `Signal` in `platform`
    error[E0412]: cannot find type `Error` in module `platform`
      --> /Users/vsergiienko/.cargo/registry/src/
    25 | impl From<::platform::Error> for Error {
       |                       ^^^^^ not found in `platform`
    help: consider importing one of these items
    1  | use Error;
    1  | use error::fmt::Error;
    1  | use std::error::Error;
    1  | use std::io::Error;

    ...and a bunch of other errors.


    $ rustc --version
    rustc 1.50.0 (cb75ad5db 2021-02-10)
    bug awaiting_confirmation 
    opened by singalen 21
  • OpenGL renderer glitches on window scale (MacOS, retina)

    OpenGL renderer glitches on window scale (MacOS, retina)

    If I try to run simple example (using default OpenGL renderer) and try to resize game window, it acts weird. With original size render area take 100% of the window. If I shrink window vertically, render area shrinks non in proportion, leaving some of the window blank. On the other hand, if I resize window to be larger, drawing area doesn't fit into window. Same happens to horizontal scaling. I think is caused by retina display on my laptop, as I've seen other issues in tracker related to hdpi display. Here's an example of drawing 80x50 red area and resizing a window: Screenshot 2020-03-31 at 11 47 35

    Source code for example:

    use bracket_lib::prelude::*;
    struct State {
    impl GameState for State {
        fn tick(&mut self, ctx: &mut BTerm) {
            ctx.fill_region(Rect::with_size(0, 0, 80, 50), ' ' as u8, RGB::named(BLACK), RGB::named(RED));
    fn main()  {
        let context = BTermBuilder::simple80x50()
            .with_title("Hello RLTK World")
        let gs: State = State {
        main_loop(context, gs)
    bug awaiting_confirmation 
    opened by ytaras 20
  • input API design

    input API design

    This issue is dedicated to designing a keyboard/mouse API that works well for both real time and turn by turn games, on native and WASM target.

    Issues with current implementation :

    • keyboard provides only keycode, no scancode or character and handles only key press events
    • mouse interprets any button event as a left click
    • the game loop can only handle one key/mouse event per tick

    API proposal :

    1. being able to check the current status of the controllers :
    impl BTerm {
        fn is_key_code_pressed(&self, key_code: KeyCode) -> bool;
        fn is_scan_code_pressed(&self, scan_code: ScanCode) -> bool;
        fn is_mouse_button_pressed(&self, button_num: usize)-> bool;
        fn mouse_cell_pos(&self) -> (i32, i32); // in console cell coordinates
        fn mouse_pixel_pos(&self) -> (f64,f64); // in pixels
    1. but also provide the raw events to the user
    impl BTerm {
        fn pop_event(&mut self) -> Option<InputEvent>;

    I prefer a pop_event function to an iterator to avoid having to deal with a clear_event function in case the game logic is updated more than once per tick.

    As for input events, winit does it pretty well, we should stick to it : Keyboard events can be defined as KeyPress/KeyRelease (or KeyInput with a state). Both events contain both key_code and scan_code when possible. Mouse button events are MousePress/MouseRelease (or MouseInput) and MouseWheel for scrolling events Text input can use a dedicated CharEvent containing a char field.

    enhancement awaiting_confirmation 
    opened by jice-nospam 15
  • Glitch in drawing of sparse console with variable size

    Glitch in drawing of sparse console with variable size

    The following changes the sparse console's size every tick. Is this just happening on my end or is the drawing glitchy?

    use bracket_terminal::prelude::*;
    struct State {
        n: i32,
    impl GameState for State {
        fn tick(&mut self, ctx: &mut BTerm) {
            let mut draw_batch = DrawBatch::new();
            self.n = (self.n + 1) % 80;
                Rect::with_size(0, 0, self.n, 1),
                ColorPair::new(RGB::named(WHITE), RGB::named(BLACK)),
            draw_batch.submit(0).expect("Batch error");
            render_draw_buffer(ctx).expect("Render error");
    fn main() -> BError {
        let context = BTermBuilder::simple80x50()
            .with_font("vga8x16.png", 8u32, 16u32)
            .with_sparse_console(80u32, 25u32, "vga8x16.png")
        let gs = State { n: 0 };
        main_loop(context, gs)

    Here's a screenshot of the glitch:


    opened by imoea 14
  • doryen_rs merge

    doryen_rs merge

    I'm creating this issue to track work related to merging doryen_rs and bracket-lib. Items that eventually require work in bracket-lib will have their dedicated issue.


    • [ ] MISSING cargo-web not supported. To be investigated


    • [ ] MISSING easy way to save a screenshot, like BTerm::save_screenshot(file_path: &str)
    opened by jice-nospam 14
  • Compile issues when targeting aarch64-apple-darwin (Apple M1)

    Compile issues when targeting aarch64-apple-darwin (Apple M1)

    Seeing a few of these when I try to compile on:

    Default host: aarch64-apple-darwin

       Compiling winit v0.22.2
    error[E0308]: mismatched types
       --> /Users/andrew/.cargo/registry/src/
    170 |                 ns_window.setFrame_display_(new_rect, 0);
        |                                                       ^ expected `bool`, found integer

    It looks like winit v0.23.0 fixes this

    opened by abowerman 13
  • Tracking issue: new scaling system

    Tracking issue: new scaling system

    Making the next feature branch a scaling system. I'm hoping that this will resolve quite a few issues that have been reported, while not breaking the API (I'm not asking much, eh?). Since there's a lot of moving parts related to the two scaling systems (simply scaling consoles and growing/shrinking the terminal size dynamically), this deserves its own branch while the kinks are worked out.


    • Support gutters around the render area. This alleviates the window rounding seen with Big Sur (and in danger of hitting Win11 by the looks of it), and supports other scaling enhancements.
    • Accurate font size in texture coordinates when blitting, to avoid the missing-pixel issues that have caused so many problems.
    • Probably optional, but "perfect" scaling: add to the gutter until the size is a multiple of the font size, and then scale the font by a consistent amount (or expand/shrink the console by a fixed amount).

    Developing will take place in the branch.

    This directly affects the following issues: #226 #220 #213 #178 #171

    opened by thebracket 10
  • Resizing a BTerm

    Resizing a BTerm

    When I resize a BTerm after creation, the characters in the window grow and shrink with it. Is it possible to increase and decrease the number of characters in a BTerm, so as to keep the size of the characters constant?

    bug enhancement 
    opened by Cthutu 10
  • Compiled binaries do not work on another machine?

    Compiled binaries do not work on another machine?

    I have a toy bracket-lib app running locally using a simple terminal.

    Using MacOS 12.3.1 I execute cargo build locally to produce a complied binary, and try to run it on another MacOS 12.3.1 machine.

    The binary will not run on this other machine, the shell says operation not permitted: ./text_writer. If I try to run it from Finder I get the following dialog:


    Both machines are the same type and architecture (Apple M1 Max chip). I haven't experienced this with other Rust built binaries, so I'm assuming there is some dynamic library being linked here that I don't know about when using bracket-lib.

    I couldn't find anything in the manual about the best way to bundle / package your bracket game for distribution. Am I doing something obviously wrong?

    opened by johnmcdowall 0
  • Bevy support doesn't appear to be usable

    Bevy support doesn't appear to be usable

    I'm new to rust, so I might be missing something, but it appears that there isn't any way to install the bevy plugin, at least through cargo.toml. The bracket-bevy crate doesn't seem to have been uploaded to

    $ cargo add bracket-bevy
        Updating index
    error: the crate `bracket-bevy` could not be found in registry index.

    and the bevy feature in bracket-lib appears to be broken due to asking for the bevy feature from bracket-geometry, which doesn't exist:

    bevy = "0.9.1"
    bracket-lib = { version = "0.8.7", features = ["bevy"] }
    $ cargo run
        Blocking waiting for file lock on package cache
        Updating index
    error: failed to select a version for `bracket-geometry`.
        ... required by package `bracket-lib v0.8.7`
        ... which satisfies dependency `bracket-lib = "^0.8.7"` of package `<>`
    versions that meet the requirements `~0.8` are: 0.8.7, 0.8.3, 0.8.2, 0.8.1, 0.8.0
    the package `bracket-lib` depends on `bracket-geometry`, with features: `bevy` but `bracket-geometry` does not have these features.
    all possible versions conflict with previously selected packages.
      previously selected package `bevy v0.9.1`
        ... which satisfies dependency `bevy = "^0.9.1"` of package `<>`
    failed to select a version for `bracket-geometry` which could resolve this conflict
    opened by chris-janidlo 2
  • Does not work with eGPU

    Does not work with eGPU

    When running with an eGPU, bracket shows a black screen momentarily then errors:

    Initialized OpenGL with: 4.1 ATI-4.9.50, Shader Language Version: 4.10
    thread 'main' panicked at '[GL] Error: INVALID_ENUM', /Users/wyattstanke/.cargo/registry/src/

    Full backtrace:

    thread 'main' panicked at '[GL] Error: INVALID_ENUM', /Users/wyattstanke/.cargo/registry/src/
    stack backtrace:
       0:        0x100cb1da6 - std::backtrace_rs::backtrace::libunwind::trace::hd1b43f283b1dbd44
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/../../backtrace/src/backtrace/
       1:        0x100cb1da6 - std::backtrace_rs::backtrace::trace_unsynchronized::h8614ff1dba85f493
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/../../backtrace/src/backtrace/
       2:        0x100cb1da6 - std::sys_common::backtrace::_print_fmt::h7d215e53299f06fa
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/sys_common/
       3:        0x100cb1da6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0cce1bf68f1b36b3
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/sys_common/
       4:        0x100ccb7fa - core::fmt::write::h1006c44db93fb025
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/core/src/fmt/
       5:        0x100caf6fc - std::io::Write::write_fmt::h6441c095ef280000
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/io/
       6:        0x100cb1b8a - std::sys_common::backtrace::_print::h842a675871b4c98f
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/sys_common/
       7:        0x100cb1b8a - std::sys_common::backtrace::print::h956930f13a633a90
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/sys_common/
       8:        0x100cb33c3 - std::panicking::default_hook::{{closure}}::hd74f355dd4e33e7d
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
       9:        0x100cb3118 - std::panicking::default_hook::h3f68e2622c07ad58
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      10:        0x100cb3af3 - std::panicking::rust_panic_with_hook::h6fcf23cb5a227488
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      11:        0x100cb3883 - std::panicking::begin_panic_handler::{{closure}}::h01cbd742ec2a323f
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      12:        0x100cb2248 - std::sys_common::backtrace::__rust_end_short_backtrace::ha4b1a3da54778532
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/sys_common/
      13:        0x100cb358d - rust_begin_unwind
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      14:        0x100cd9463 - core::panicking::panic_fmt::h72cdfd070c864d38
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/core/src/
      15:        0x100a68e86 - bracket_terminal::hal::gl_common::glerror::gl_error::hfe8542ff88185bdc
                                   at /Users/wyattstanke/.cargo/registry/src/
      16:        0x100a4afd5 - bracket_terminal::hal::gl_common::shader::Shader::useProgram::h749093a0064f05f1
                                   at /Users/wyattstanke/.cargo/registry/src/
      17:        0x100a10eda - bracket_terminal::hal::native::mainloop::tock::hc4816b42b743897c
                                   at /Users/wyattstanke/.cargo/registry/src/
      18:        0x100a1272a - bracket_terminal::hal::native::mainloop::main_loop::{{closure}}::h77babcd34958db73
                                   at /Users/wyattstanke/.cargo/registry/src/
      19:        0x100a1a361 - <winit::platform_impl::platform::app_state::EventLoopHandler<T> as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::{{closure}}::hc1c9f15120099592
                                   at /Users/wyattstanke/.cargo/registry/src/
      20:        0x100a1aa3d - winit::platform_impl::platform::app_state::EventLoopHandler<T>::with_callback::h6820fd567f2cd3db
                                   at /Users/wyattstanke/.cargo/registry/src/
      21:        0x100a1a177 - <winit::platform_impl::platform::app_state::EventLoopHandler<T> as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::h1f1994e1d086cc8e
                                   at /Users/wyattstanke/.cargo/registry/src/
      22:        0x100be5fd4 - winit::platform_impl::platform::app_state::Handler::handle_nonuser_event::h3c44c42f7fd01d84
                                   at /Users/wyattstanke/.cargo/registry/src/
      23:        0x100be805e - winit::platform_impl::platform::app_state::AppState::cleared::h349a837d988dbb3b
                                   at /Users/wyattstanke/.cargo/registry/src/
      24:        0x100bb74b0 - winit::platform_impl::platform::observer::control_flow_end_handler::{{closure}}::h312e41ec25b27195
                                   at /Users/wyattstanke/.cargo/registry/src/
      25:        0x100bb72e8 - winit::platform_impl::platform::observer::control_flow_handler::{{closure}}::h882dfdd1ebc757e3
                                   at /Users/wyattstanke/.cargo/registry/src/
      26:        0x100bd435b - std::panicking::try::do_call::hd1a237f13320e24a
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      27:        0x100bda50d - ___rust_try
      28:        0x100bd41c2 - std::panicking::try::h0705863bbb82ef16
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      29:        0x100ba5945 - std::panic::catch_unwind::h87a260c6e64af483
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      30:        0x100beab4e - winit::platform_impl::platform::event_loop::stop_app_on_panic::he6edf854f818a361
                                   at /Users/wyattstanke/.cargo/registry/src/
      31:        0x100bb7279 - winit::platform_impl::platform::observer::control_flow_handler::h8dcc955150fabcb4
                                   at /Users/wyattstanke/.cargo/registry/src/
      32:        0x100bb7440 - winit::platform_impl::platform::observer::control_flow_end_handler::h0aebabf0d4976353
                                   at /Users/wyattstanke/.cargo/registry/src/
      33:     0x7ff807a310c2 - <unknown>
      34:     0x7ff807a30fea - <unknown>
      35:     0x7ff807a30695 - <unknown>
      36:     0x7ff807a2fb90 - <unknown>
      37:     0x7ff811431a06 - <unknown>
      38:     0x7ff811431816 - <unknown>
      39:     0x7ff811431553 - <unknown>
      40:     0x7ff80ab76163 - <unknown>
      41:     0x7ff80ab74fe4 - <unknown>
      42:     0x7ff80ab67623 - <unknown>
      43:        0x100c150a1 - <() as objc::message::MessageArguments>::invoke::h07dbdd62d230c28d
                                   at /Users/wyattstanke/.cargo/registry/src/
      44:        0x100c14312 - objc::message::platform::send_unverified::hdddc6b90de6e6a43
                                   at /Users/wyattstanke/.cargo/registry/src/
      45:        0x100a1919c - objc::message::send_message::h83184afdb8a8e6a9
                                   at /Users/wyattstanke/.cargo/registry/src/
      46:        0x100a1919c - winit::platform_impl::platform::event_loop::EventLoop<T>::run_return::{{closure}}::h5e246f1c93c5ba79
                                   at /Users/wyattstanke/.cargo/registry/src/
      47:        0x100a0f69c - objc::rc::autorelease::autoreleasepool::he2cfa3a686c862d4
                                   at /Users/wyattstanke/.cargo/registry/src/
      48:        0x100a18d87 - winit::platform_impl::platform::event_loop::EventLoop<T>::run_return::hee27512062ebcbe1
                                   at /Users/wyattstanke/.cargo/registry/src/
      49:        0x100a193ed - winit::platform_impl::platform::event_loop::EventLoop<T>::run::h5b54841bafcc4628
                                   at /Users/wyattstanke/.cargo/registry/src/
      50:        0x100a154dc - winit::event_loop::EventLoop<T>::run::hbfec3c507e7f00e0
                                   at /Users/wyattstanke/.cargo/registry/src/
      51:        0x100a1220d - bracket_terminal::hal::native::mainloop::main_loop::he7d518038ecfed59
                                   at /Users/wyattstanke/.cargo/registry/src/
      52:        0x100a13f7d - bracket_terminal::bterm::main_loop::hf46e22a038750675
                                   at /Users/wyattstanke/.cargo/registry/src/
      53:        0x100a16635 - autoquest::main::h6dfd62ae0fdb5693
                                   at /Users/wyattstanke/OSS/autoquest/src/
      54:        0x100a1989e - core::ops::function::FnOnce::call_once::h51a019c128f58d37
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/core/src/ops/
      55:        0x100a15fc1 - std::sys_common::backtrace::__rust_begin_short_backtrace::h98e0a41827845c78
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/sys_common/
      56:        0x100a13824 - std::rt::lang_start::{{closure}}::hd37d89d50c946301
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      57:        0x100cac104 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h74cba4256ed7cb7c
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/core/src/ops/
      58:        0x100cac104 - std::panicking::try::do_call::hbd30b6cee98c6d1f
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      59:        0x100cac104 - std::panicking::try::hf8e6ce82919028ea
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      60:        0x100cac104 - std::panic::catch_unwind::hf56af96fd91edbc3
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      61:        0x100cac104 - std::rt::lang_start_internal::{{closure}}::h7640439d61d81acf
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      62:        0x100cac104 - std::panicking::try::do_call::h16ae1d811f67c8a4
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      63:        0x100cac104 - std::panicking::try::hb73944cd4bafb33c
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      64:        0x100cac104 - std::panic::catch_unwind::h42a98569449bc7cc
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      65:        0x100cac104 - std::rt::lang_start_internal::h548a633570735ecf
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      66:        0x100a137f7 - std::rt::lang_start::ha195670d699e6abf
                                   at /rustc/c97b539e408ea353f4fde2f9251d598291fec421/library/std/src/
      67:        0x100a16708 - _main
      68:     0x7ff807624310 - <unknown>


    name = "autoquest"
    version = "0.1.0"
    edition = "2021"
    # See more keys and their definitions at
    bracket-lib = "0.8.7"

    use bracket_lib::prelude::*;
    struct State {}
    impl GameState for State {
        fn tick(&mut self, ctx: &mut BTerm) {
            ctx.print(1, 1, "Hello Bracket World");
    fn main() -> BError {
        let context = BTermBuilder::simple80x50()
            .with_title("Hello Minimal Bracket World")
        let gs: State = State {};
        main_loop(context, gs)

    System information:

    uname -a: Darwin Wyatts-Mac-mini.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Oct 28 06:50:33 PDT 2022; root:xnu-8792.60.51~15/RELEASE_X86_64 x86_6
    eGPU: Radeon RX 580
    eGPU Extra:
      Chipset Model:	AMD Radeon RX 580
      Type:	External GPU
      Bus:	PCIe
      PCIe Lane Width:	x4
      VRAM (Total):	8 GB
      Vendor:	AMD (0x1002)
      Device ID:	0x67df
      Revision ID:	0x00e7
      Metal Support:	Metal 3
      GPU is Removable:	Yes
    MacOS Version: 13.1 Beta (22C5044e)

    Note that this works without an eGPU just fine.

    opened by Wyatt-Stanke 0
  • Crash on mouse hover on Wayland

    Crash on mouse hover on Wayland


    I am getting a crash running the tutorial code. This is on Fedora 36, running Gnome and Wayland. The window is created normally, but as soon as the mouse cursor hovers the window, the program exits with the following output. If the mouse cursor happens to be within the window bounds when the program starts, the program exits immediately.

    Initialized OpenGL with: 4.6 (Core Profile) Mesa 22.1.7, Shader Language Version: 4.60
    Error sending request: Resource temporarily unavailable

    The contents of the project:


    name = "bracket_bug"
    version = "0.1.0"
    edition = "2021"
    # See more keys and their definitions at
    bracket-lib = "0.8"

    use bracket_lib::prelude::*;
    struct State {}
    impl GameState for State {
        fn tick(&mut self, ctx: &mut BTerm) {
            ctx.print(1, 1, "Hello Bracket World");
    fn main() -> BError {
        let context = BTermBuilder::simple80x50()
            .with_title("Hello Minimal Bracket World")
        let gs: State = State {};
        main_loop(context, gs)

    I am happy to provide more information, but please bear in mind I am just learning Rust, and I would appreciate it if you could also provide some instructions on how to obtain any traces/logs you might want to see.

    opened by dandrestor 3
Amethyst Foundation
Non-Profit with focus on Rust and the Game Dev ecosystem.
Amethyst Foundation
Toolkit for working with scripts used by REDengine in Cyberpunk 2077.

redscript Toolkit for working with scripts used by REDengine in Cyberpunk 2077. Currently includes a compiler, a decompiler and a disassembler. usage

jac3km4 268 Jan 6, 2023
Keyboard firmware implemented in Rust

flutterby-rs Keyboard firmware implemented in Rust. It doesn't do anything useful yet! Building for atmega32u4 devices (ergodox-ez, feather32u4) First

Wez Furlong 26 Dec 31, 2022
A zsh histb browser using skim. Implemented in rust.

A zsh histb browser using skim. Implemented in rust.

Matthias Bilger 18 Nov 17, 2022
Nix binary cache implemented in rust using libnix-store

harmonia Build Whole application nix-shell --run cargo b C Library Wrapper around libnixstore nix-shell --run make Note: The makefile is only to pro

Helsinki Systems 84 Dec 24, 2022
Arduino Uno 9 axis acceleration sensor (BMX055) reader implemented in Rust.

Arduino Uno Accelaration reader in Rust Components Arduino Uno (Probably possible with other AVR microcontrollers) BMX055 (Japanese website) Datasheet

Katsu Uchiyama 3 Dec 15, 2022
This is a Pomodoro Clock implemented as a Zellij plugin.

Pomodoro Clock This is a Pomodoro Clock implemented as a Zellij plugin. It shows a Pomodoro time as well as current date time. Prerequisite You must i

Tw 15 Nov 14, 2022
An ND812 decoder implemented as part of the yaxpeax project

yaxpeax-nd812 an ND812 decoder implemented as part of the yaxpeax project, including traits provided by yaxpeax-arch. the ND812 is a 12-bit microcompu

iximeow 1 Jan 22, 2022
k-mer counter in Rust using the rust-bio and rayon crates

krust is a k-mer counter written in Rust and run from the command line that will output canonical k-mers and their frequency across the records in a f

null 14 Jan 7, 2023
Experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code

Diplomat is an experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code. With Diplomat, you can simply define Rust APIs to be exposed over FFI and get high-level C, C++, and JavaScript bindings automatically!

null 255 Dec 30, 2022
Aws-sdk-rust - AWS SDK for the Rust Programming Language

The AWS SDK for Rust This repo contains the new AWS SDK for Rust (the SDK) and its public roadmap. Please Note: The SDK is currently released as a dev

Amazon Web Services - Labs 2k Jan 3, 2023
Rust + Yew + Axum + Tauri, full-stack Rust development for Desktop apps.

rust-yew-axum-tauri-desktop template Rust + Yew + Axum + Tauri, full-stack Rust development for Desktop apps. Crates frontend: Yew frontend app for de

Jet Li 54 Dec 23, 2022
A lightning fast version of tmux-fingers written in Rust, copy/pasting tmux like vimium/vimperator

tmux-thumbs A lightning fast version of tmux-fingers written in Rust for copy pasting with vimium/vimperator like hints. Usage Press ( prefix + Space

Ferran Basora 598 Jan 2, 2023
A command-line tool collection to assist development written in RUST

dtool dtool is a command-line tool collection to assist development Table of Contents Description Usage Tips Installation Description Now dtool suppor

GB 314 Dec 18, 2022
Rust mid-level IR Abstract Interpreter

MIRAI MIRAI is an abstract interpreter for the Rust compiler's mid-level intermediate representation (MIR). It is intended to become a widely used sta

Facebook Experimental 793 Jan 2, 2023
Migrate C code to Rust

C2Rust helps you migrate C99-compliant code to Rust. The translator (or transpiler) produces unsafe Rust code that closely mirrors the input C code. T

Immunant 3k Jan 8, 2023
C to Rust translator

Corrode: Automatic semantics-preserving translation from C to Rust This program reads a C source file and prints an equivalent module in Rust syntax.

Jamey Sharp 2.1k Dec 14, 2022
Astronomical algorithms in Rust

astro-rust Contents API Docs About Usage Contributing References About astro-rust is a library of advanced astronomical algorithms for the Rust progra

Saurav Sachidanand 213 Jan 7, 2023
A Rust library for calculating sun positions

sun A rust port of the JS library suncalc. Install Add the following to your Cargo.toml [dependencies] sun = "0.2" Usage pub fn main() { let unixti

Markus Kohlhase 36 Dec 28, 2022
Macro for Python-esque comprehensions in Rust

Cute Macro for Python-esque list comprehensions in Rust. The c! macro implements list and hashmap comprehensions similar to those found in Python, all

Matt Gathu 306 Jan 6, 2023