Skip to content

Settings Configuration

Finalspace edited this page May 29, 2026 · 2 revisions

Table of Contents

FPL is configured through a single fplSettings structure, which is passed to fplPlatformInit() .

It groups all configuration into one container with a sub-structure for each subsystem:

Field Type Configures
window fplWindowSettings Window title, size, position, style, callbacks
video fplVideoSettings Video backend (OpenGL, Vulkan, Software), vsync
audio fplAudioSettings Audio backend, format, device, buffer sizes
input fplInputSettings Input backends, gamepad detection frequency
console fplConsoleSettings Console subsystem configuration
memory fplMemorySettings Custom memory allocator configuration

Creating default settings

You should never use an uninitialized fplSettings structure. FPL provides two ways to obtain a fully populated default configuration.

Use fplMakeDefaultSettings() to get a settings structure by value:

 settings = ();

Or use fplSetDefaultSettings() to reset an existing structure in place:

 settings;
(&settings);

Note: Neither function changes the active settings - they only fill the structure. The settings only take effect when passed to

fplPlatformInit() .

Modifying settings

After creating the defaults, change only the fields you care about, then pass the structure into fplPlatformInit() .

 settings = ();
("My Game", settings.., (settings..));
settings... = 1280;
settings... = 720;

if ((, &settings)) {
    // ...
    ();
}

See Initialization with custom settings for the full initialization workflow.

Per-subsystem default helpers

If you only want to reset a single subsystem, FPL provides dedicated helper functions:

Function Resets
fplSetDefaultWindowSettings() fplWindowSettings
fplSetDefaultVideoSettings() fplVideoSettings
fplSetDefaultAudioSettings() fplAudioSettings
fplSetDefaultInputSettings() fplInputSettings
fplSetDefaultConsoleSettings() fplConsoleSettings
 videoSettings;
(&videoSettings);

Querying the active settings

Once the platform is initialized, you can retrieve the currently active configuration by calling fplGetCurrentSettings() .

It returns a read-only pointer to the fplSettings used by FPL.

const  *current = ();
("Window size: %dx%d\n",
    current->.., current->..);

Note: Modifying the returned structure has no effect on the running platform. Settings are applied at

fplPlatformInit() time only.

Final Platform Layer

Pages

Topics

Data Structures

Clone this wiki locally