![]() |
Gorgon Game Engine
|
Console manipulation functions. Not thread safe. Current only std::cout is supported. More...
Public Types | |
| enum | Color { Default, Black, White, Red, Cyan, Blue, Yellow, Magenta, Green } |
| The colors that can be used for console coloring. This is a safe list. More... | |
| enum | ColorSupportLevel { None, Safelist, RGB } |
| Level of support for color. More... | |
Public Member Functions | |
| Console ()=default | |
| Empty console, nothing can be done with it. More... | |
| Console (ConsoleBackend &backend) | |
| Creates a new console with the specified backend. More... | |
| Console (const Console &other) | |
| Console objects can be copied. They are reference counted. More... | |
| ~Console () | |
| void | ClearScreen () |
| Clears the console screen. More... | |
| ColorSupportLevel | ColorSupport () const |
| Returns if color is supported in this terminal. More... | |
| int | GetHeight () const |
| Returns the size of the console window in cols/rows. More... | |
| Geometry::Size | GetSize () const |
| Returns the size of the console window in cols/rows. More... | |
| int | GetWidth () const |
| Returns the size of the console window in cols/rows. More... | |
| void | GotoXY (Geometry::Point location) |
| Changes the position of the caret to the given position. More... | |
| void | GotoXY (int x, int y) |
| Changes the position of the caret to the given position. More... | |
| void | HideCaret () |
| Hides input cursor. More... | |
| bool | IsColorSupported () const |
| Returns if the color is supported by this console. More... | |
| bool | IsReady () const |
| Returns if the console is usable. More... | |
| bool | IsStylesSupported () const |
| Returns if color is supported in this terminal. Even if this is false, bold can be emulated. More... | |
| operator bool () const | |
| Returns if the console is usable. More... | |
| Console & | operator= (const Console &other) |
| Console objects can be copied. They are reference counted. More... | |
| std::ostream & | OutStream () const |
| void | Reset () |
| Resets terminal attributes. More... | |
| void | SetBackground (Color color) |
| Sets the background color to the given value. Use Default to set it to default color. More... | |
| void | SetBackground (Graphics::RGBA color) |
| Sets the background color to the given value. Use Default to set it to default color. More... | |
| void | SetBold (bool bold=true) |
| Sets terminal font to bold or normal. More... | |
| void | SetColor (Color color) |
| Sets the color to the given value, avoid, black and white as console can have its background color reversed. More... | |
| void | SetColor (Graphics::RGBA color) |
| Sets the color to the given value, avoid, black and white as console can have its background color reversed. More... | |
| void | SetItalic (bool italic=true) |
| Enable/disable italic. Not all consoles support italic. More... | |
| void | SetNegative (bool negative=true) |
| Background/foreground is switched. More... | |
| void | SetUnderline (bool underline=true) |
| Enable/disable underline. Not all consoles support underline. More... | |
| void | ShowCaret () |
| Shows input cursor. More... | |
Console manipulation functions. Not thread safe. Current only std::cout is supported.
| enum Color |
| enum ColorSupportLevel |
Level of support for color.
| Enumerator | |
|---|---|
| None | Color is not supported. |
| Safelist | Only colors in the safelist can be used. |
| RGB | Graphics::RGBA can be used for color. |
| Console | ( | ConsoleBackend & | backend | ) |
Creates a new console with the specified backend.
| ~Console | ( | ) |
| void ClearScreen | ( | ) |
Clears the console screen.
| ColorSupportLevel ColorSupport | ( | ) | const |
Returns if color is supported in this terminal.
| int GetHeight | ( | ) | const |
Returns the size of the console window in cols/rows.
| Geometry::Size GetSize | ( | ) | const |
Returns the size of the console window in cols/rows.
| int GetWidth | ( | ) | const |
Returns the size of the console window in cols/rows.
| void GotoXY | ( | Geometry::Point | location | ) |
Changes the position of the caret to the given position.
| void GotoXY | ( | int | x, |
| int | y | ||
| ) |
Changes the position of the caret to the given position.
References Console::GotoXY().
| void HideCaret | ( | ) |
Hides input cursor.
| bool IsColorSupported | ( | ) | const |
Returns if the color is supported by this console.
References Console::ColorSupport(), and Console::None.
| bool IsReady | ( | ) | const |
Returns if the console is usable.
| bool IsStylesSupported | ( | ) | const |
Returns if color is supported in this terminal. Even if this is false, bold can be emulated.
|
explicit |
Returns if the console is usable.
References Console::IsReady().
Console objects can be copied. They are reference counted.
| std::ostream& OutStream | ( | ) | const |
| void Reset | ( | ) |
Resets terminal attributes.
| void SetBackground | ( | Color | color | ) |
Sets the background color to the given value. Use Default to set it to default color.
| void SetBackground | ( | Graphics::RGBA | color | ) |
Sets the background color to the given value. Use Default to set it to default color.
| void SetBold | ( | bool | bold = true | ) |
Sets terminal font to bold or normal.
| void SetColor | ( | Color | color | ) |
Sets the color to the given value, avoid, black and white as console can have its background color reversed.
Use Default to set it to default color.
| void SetColor | ( | Graphics::RGBA | color | ) |
Sets the color to the given value, avoid, black and white as console can have its background color reversed.
Use Default to set it to default color.
| void SetItalic | ( | bool | italic = true | ) |
Enable/disable italic. Not all consoles support italic.
| void SetNegative | ( | bool | negative = true | ) |
Background/foreground is switched.
| void SetUnderline | ( | bool | underline = true | ) |
Enable/disable underline. Not all consoles support underline.
| void ShowCaret | ( | ) |
Shows input cursor.