amethyst / amethyst/bracket-lib
Issues using terminal with another game loop
- Langage dominant
- Rust
- Étoiles
- 1.7k
- Forks
- 126
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
First, thanks for this library! I've enjoyed reading your RLTK tutorial, and while I've built other games, it has inspired me to dip a toe into roguelike development.
I'm trying to use Bracket with [Bevy](https://bevyengine.org). My first goal is to use either curses or crossterm, then scale up from there. So I don't want to use Bracket's game loop, but want to integrate it with Bevy, and wrap whatever terminal logic it needs in Bevy systems.
I've currently got this code, and it behaves differently in different scenarios. The code:
```
// use bevy::prelude::*;
use bracket_lib::prelude::*;
// fn render_system(mut terminal: ResMut) {
// terminal.print(1, 1, "Hello, world.");
// }
fn main() -> BError {
let mut terminal = BTermBuilder::simple(80, 25)?.build()?;
terminal.cls();
terminal.print(5, 5, "Hello, world.\n");
// App::build()
// .add_plugin(bevy::app::ScheduleRunnerPlugin::default())
// .add_resource(terminal)
// .add_system(render_system.system())
// .run();
Ok(())
}
```
* Windows and WSL2 with curses feature: Clears the screen, prints nothing.
* Windows and WSL2 with crossterm feature: Does nothing.
Am I doing something wrong? Your tutorials run the ECS loop inside Bracket's. Given that I'm inverting the pattern, do I need to add some sort of terminal update loop? I see `BTerm::main_loop`, but I'm not sure if this is meant to wrap my game loop, or if it contains logic I need to call to update the terminal itself.
Thanks again.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.