-
Notifications
You must be signed in to change notification settings - Fork 13
Settings Configuration
- Creating default settings
- Modifying settings
- Per-subsystem default helpers
- Querying the active settings
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 |
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
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.
If you only want to reset a single subsystem, FPL provides dedicated helper functions:
videoSettings;
(&videoSettings);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.
- Assertion & Debug
- Atomic operations
- Audio functions
- Clipboard functions
- Console functions
- Constants
- Display/Monitor functions
- Dynamic library loading
- Error Handling
- Files/IO functions
- Function macros
- Hardware Infos
- Input types and functions
- Localization functions
- Logging
- Memory Macros
- Memory functions
- Operating system Infos
- Path functions
- Platform functions
- Session Infos
- Settings & Configurations
- Storage class identifiers
- String functions
- Threading and synchronizations routines
- Timing functions
- Video functions
- Window events
- Window functions
- fplARMCPUCapabilities
- fplAudioChannelMap
- fplAudioDeviceID
- fplAudioDeviceInfo
- fplAudioFormat
- fplAudioSettings
- fplColor32
- fplConditionVariable
- fplConsoleSettings
- fplCPUCapabilities
- fplCPUIDLeaf
- fplDateTime
- fplDateTimeCreationResult
- fplDateTimeResult
- fplDisplayInfo
- fplDisplayMode
- fplDynamicLibraryHandle
- fplEndianess
- fplEvent
- fplFileEntry
- fplFileHandle
- fplFilePermissions
- fplFileTimeStamps
- fplGamepadButton
- fplGamepadData
- fplGamepadEvent
- fplGamepadInfo
- fplGamepadInputBinding
- fplGamepadMapping
- fplGamepadSettings
- fplGamepadState
- fplGamepadStates
- fplGraphicsApiSettings
- fplImageSource
- fplInputBackendMask
- fplInputBackendSupport
- fplInputDevice
- fplInputDeviceGuid
- fplInputSettings
- fplInternalConditionVariable
- fplInternalDynamicLibraryHandle
- fplInternalFileEntryHandle
- fplInternalFileHandle
- fplInternalFileRootInfo
- fplInternalMutexHandle
- fplInternalSemaphoreHandle
- fplInternalSignalHandle
- fplInternalThreadHandle
- fplKeyboardEvent
- fplKeyboardState
- fplLogSettings
- fplLogWriter
- fplLogWriterConsole
- fplLogWriterCustom
- fplMemoryAllocationSettings
- fplMemoryBlock
- fplMemoryInfos
- fplMemorySettings
- fplMouseEvent
- fplMouseState
- fplMutexHandle
- fplOpenGLSettings
- fplOSVersionInfos
- fplSemaphoreHandle
- fplSettings
- fplSignalHandle
- fplSpecificAudioSettings
- fplThreadHandle
- fplThreadParameters
- fplTimestamp
- fplVersionInfo
- fplVideoBackBuffer
- fplVideoRect
- fplVideoRequirements
- fplVideoRequirementsVulkan
- fplVideoSettings
- fplVideoSurface
- fplVideoSurfaceOpenGL
- fplVideoSurfaceVulkan
- fplVideoWindow
- fplVulkanSettings
- fplWindowCallbacks
- fplWindowDropFiles
- fplWindowEvent
- fplWindowPosition
- fplWindowSettings
- fplWindowSize
- fplX86CPUCapabilities