libnx
v4.8.0
|
Framebuffer text console. More...
#include "../../types.h"
Go to the source code of this file.
Data Structures | |
struct | ConsoleRenderer |
Renderer interface for the console. More... | |
struct | ConsoleFont |
A font struct for the console. More... | |
struct | PrintConsole |
Console structure used to store the state of a console render context. More... | |
Macros | |
#define | CONSOLE_ESC(x) "\x1b[" #x |
#define | CONSOLE_RESET CONSOLE_ESC(0m) |
#define | CONSOLE_BLACK CONSOLE_ESC(30m) |
#define | CONSOLE_RED CONSOLE_ESC(31;1m) |
#define | CONSOLE_GREEN CONSOLE_ESC(32;1m) |
#define | CONSOLE_YELLOW CONSOLE_ESC(33;1m) |
#define | CONSOLE_BLUE CONSOLE_ESC(34;1m) |
#define | CONSOLE_MAGENTA CONSOLE_ESC(35;1m) |
#define | CONSOLE_CYAN CONSOLE_ESC(36;1m) |
#define | CONSOLE_WHITE CONSOLE_ESC(37;1m) |
#define | CONSOLE_COLOR_BOLD (1<<0) |
Bold text. | |
#define | CONSOLE_COLOR_FAINT (1<<1) |
Faint text. | |
#define | CONSOLE_ITALIC (1<<2) |
Italic text. | |
#define | CONSOLE_UNDERLINE (1<<3) |
Underlined text. | |
#define | CONSOLE_BLINK_SLOW (1<<4) |
Slow blinking text. | |
#define | CONSOLE_BLINK_FAST (1<<5) |
Fast blinking text. | |
#define | CONSOLE_COLOR_REVERSE (1<<6) |
Reversed color text. | |
#define | CONSOLE_CONCEAL (1<<7) |
Concealed text. | |
#define | CONSOLE_CROSSED_OUT (1<<8) |
Crossed out text. | |
#define | CONSOLE_FG_CUSTOM (1<<9) |
Foreground custom color. | |
#define | CONSOLE_BG_CUSTOM (1<<10) |
Background custom color. | |
Enumerations | |
enum | debugDevice { debugDevice_NULL , debugDevice_SVC , debugDevice_CONSOLE } |
Console debug devices supported by libnx. More... | |
Functions | |
void | consoleSetFont (PrintConsole *console, ConsoleFont *font) |
Loads the font into the console. More... | |
void | consoleSetWindow (PrintConsole *console, int x, int y, int width, int height) |
Sets the print window. More... | |
PrintConsole * | consoleGetDefault (void) |
Gets a pointer to the console with the default values. More... | |
PrintConsole * | consoleSelect (PrintConsole *console) |
Make the specified console the render target. More... | |
PrintConsole * | consoleInit (PrintConsole *console) |
Initialise the console. More... | |
void | consoleExit (PrintConsole *console) |
Deinitialise the console. More... | |
void | consoleUpdate (PrintConsole *console) |
Updates the console, submitting a new frame to the display. More... | |
void | consoleDebugInit (debugDevice device) |
Initializes debug console output on stderr to the specified device. More... | |
void | consoleClear (void) |
Clears the screan by using printf("\x1b[2J");. | |
Framebuffer text console.
Provides stdio integration for printing to the Switch screen as well as debug print functionality provided by stderr.
General usage is to initialize the console by:
optionally customizing the console usage by passing a pointer to a custom PrintConsole struct.
enum debugDevice |
Console debug devices supported by libnx.
void consoleDebugInit | ( | debugDevice | device | ) |
Initializes debug console output on stderr to the specified device.
device | The debug device (or devices) to output debug print statements to. |
void consoleExit | ( | PrintConsole * | console | ) |
Deinitialise the console.
console | A pointer to the console data to initialize (if it's NULL, the default console will be used). |
PrintConsole* consoleGetDefault | ( | void | ) |
Gets a pointer to the console with the default values.
This should only be used when using a single console or without changing the console that is returned, otherwise use consoleInit().
PrintConsole* consoleInit | ( | PrintConsole * | console | ) |
Initialise the console.
console | A pointer to the console data to initialize (if it's NULL, the default console will be used). |
PrintConsole* consoleSelect | ( | PrintConsole * | console | ) |
Make the specified console the render target.
console | A pointer to the console struct (must have been initialized with consoleInit(PrintConsole* console)). |
void consoleSetFont | ( | PrintConsole * | console, |
ConsoleFont * | font | ||
) |
Loads the font into the console.
console | Pointer to the console to update, if NULL it will update the current console. |
font | The font to load. |
void consoleSetWindow | ( | PrintConsole * | console, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
Sets the print window.
console | Console to set, if NULL it will set the current console window. |
x | X location of the window. |
y | Y location of the window. |
width | Width of the window. |
height | Height of the window. |
void consoleUpdate | ( | PrintConsole * | console | ) |
Updates the console, submitting a new frame to the display.
console | A pointer to the console data to initialize (if it's NULL, the default console will be used). |