libctru v2.5.0
|
3ds stdio support. More...
Go to the source code of this file.
Data Structures | |
struct | ConsoleFont |
A font struct for the console. More... | |
struct | PrintConsole |
Console structure used to store the state of a console render context. More... | |
Typedefs | |
typedef bool(* | ConsolePrint) (void *con, int c) |
A callback for printing a character. | |
Enumerations | |
enum | debugDevice { debugDevice_NULL , debugDevice_SVC , debugDevice_CONSOLE , debugDevice_3DMOO = debugDevice_SVC } |
Console debug devices supported by libnds. More... | |
Functions | |
void | consoleSetFont (PrintConsole *console, ConsoleFont *font) |
Loads the font into the console. | |
void | consoleSetWindow (PrintConsole *console, int x, int y, int width, int height) |
Sets the print window. | |
PrintConsole * | consoleGetDefault (void) |
Gets a pointer to the console with the default values. | |
PrintConsole * | consoleSelect (PrintConsole *console) |
Make the specified console the render target. | |
PrintConsole * | consoleInit (gfxScreen_t screen, PrintConsole *console) |
Initialise the console. | |
void | consoleDebugInit (debugDevice device) |
Initializes debug console output on stderr to the specified device. | |
void | consoleClear (void) |
Clears the screen by using iprintf("\x1b[2J");. | |
3ds stdio support.
Provides stdio integration for printing to the 3DS screen as well as debug print functionality provided by stderr.
General usage is to initialize the console by:
or to customize the console usage by:
enum debugDevice |
Console debug devices supported by libnds.
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. |
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 | ( | gfxScreen_t | screen, |
PrintConsole * | console | ||
) |
Initialise the console.
screen | The screen to use for 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. |