Skip to content

Console Input Output

Finalspace edited this page May 29, 2026 · 2 revisions

Table of Contents

FPL provides a couple of functions for writing text to the console and reading a single character from it. These work with the standard output and standard error streams.

Note: To get an actual console window on Windows, include the

fplInitFlags_Console flag when calling

fplPlatformInit() .

Writing text

Use fplConsoleOut() to write plain text to the standard output and fplConsoleError() to write plain text to the standard error stream.

("Hello from standard output\n");
("Something went wrong\n");

Writing formatted text

For printf-style formatting, use fplConsoleFormatOut() for the standard output and fplConsoleFormatError() for the standard error stream. Both take a format string followed by a variable number of arguments.

int frame = 42;
("Current frame: %d\n", frame);
("Failed to load asset '%s'\n", "player.png");

Reading a character

Use fplConsoleWaitForCharInput() to block until a single character is typed into the console input, and return it.

("Press any key to continue...\n");
char c = ();
("You pressed: %c\n", c);

Notes

Final Platform Layer

Pages

Topics

Data Structures

Clone this wiki locally