pub struct Terminal { /* fields omitted */ }
The Terminal acts as the window and "canvas" of the terminal, handling most behind-the-sceneries
The Terminal is used to create the window and canvas for the TextBuffer
which can then draw it, close the window, reset the title of the window or handle events.
Note when building with debug-mode, you are able to press F3
to toggle between debug and non-debug. see (set_debug
) for more information.
use glerminal::TerminalBuilder;
let terminal = TerminalBuilder::new()
.with_title("Hello GLerminal!")
.with_dimensions((1280, 720))
.build();
In most cases you might just want to initialize the terminal as immutable, but in some, you will need to initialize it as mutable,
allowing it to run some additional methods, such as .show()
and .set_title("title")
use glerminal::TerminalBuilder;
let mut terminal = TerminalBuilder::new()
.with_title("Hello GLerminal!")
.with_dimensions((1280, 720))
.with_visibility(false)
.build();
terminal.set_title("Changed title!");
terminal.show();
Sets debug mode (changes characters and backgrounds into wireframe)
Refreshes the screen and returns whether the while-loop should continue (is the program running)
Flushes TextBuffer
, taking it's character-grid and making it show for the next draw.
This is quite a heavy function and it's calling should be avoided when unnecessary.
Draws a TextBuffer
. This should be called every frame for each text buffer.
Gets the current Events, must be retrieved every time you want new events. (ie. every frame)
Sets the title for the window.
Warning: This is a nuclear hazard (takes up a lot of performance), it might melt down your computer if called every frame (or so).
Shows the window, if it's hidden
Get the delta-time (in seconds).
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static