|
Final Platform Layer 1.0.0
|
This category contains global settings structures/enumerations and functions to initialize/set them. More...
Data Structures | |
| struct | fplAudioChannelMap |
| Stores the mapping of all audio channels to an audio speaker. More... | |
| union | fplAudioDeviceID |
| Stores the ID of the underlying backend. More... | |
| struct | fplAudioDeviceInfo |
| Stores the name and the ID of the audio device. More... | |
| struct | fplAudioFormat |
| Stores audio format properties, such as type, sample rate, channels, etc. More... | |
| struct | fplAudioSettings |
| Stores audio settings, such as format, device info, callbacks, backend, etc. More... | |
| union | fplColor32 |
| Defines a 32-bit color in format BGRA. More... | |
| struct | fplConsoleSettings |
| Stores the title and options for the console. More... | |
| struct | fplGamepadSettings |
| Stores the settings for controlling how gamepads are handled. More... | |
| struct | fplGraphicsApiSettings |
| Stores graphics API settings. More... | |
| struct | fplImageSource |
| Stores data for working with an image source. More... | |
| struct | fplInputBackendMask |
| Bitmask of enabled fplInputBackendType values. More... | |
| struct | fplInputSettings |
| Stores input settings. More... | |
| struct | fplMemoryAllocationSettings |
| Stores settings for memory allocation usage. More... | |
| struct | fplMemorySettings |
| Stores memory settings for dynamic and temporary allocations. More... | |
| struct | fplOpenGLSettings |
| Stores OpenGL video settings. More... | |
| struct | fplSettings |
| Stores settings, such as window, video, etc. More... | |
| union | fplSpecificAudioSettings |
| Stores backend-specific audio settings. More... | |
| struct | fplVideoSettings |
| Stores video settings such as backend, v-sync, API-settings, etc. More... | |
| struct | fplVulkanSettings |
| Stores Vulkan video settings. More... | |
| struct | fplWindowCallbacks |
| Stores the window callbacks. More... | |
| struct | fplWindowPosition |
| Stores the position of a window. More... | |
| struct | fplWindowSettings |
| Stores window settings, such as size, title, etc. More... | |
| struct | fplWindowSize |
| Stores the size of a window. More... | |
Macros | |
| #define | FPL_GAMEPAD_MAPPING_RESOLVE_CALLBACK(name) |
| Defines a prototype for a gamepad mapping resolver function. | |
| #define | FPL_MAX_AUDIO_CHANNEL_COUNT |
| Maximum number of audio channels. | |
| #define | FPL_MAX_INPUT_BACKEND_COUNT |
| Maximum number of input backends that can be active at once. | |
Typedefs | |
| typedef uint32_t | fpl_audio_client_read_callback(const fplAudioFormat *deviceFormat, const uint32_t frameCount, void *outputSamples, void *userData) |
| A function definition for a callback that is called to read audio samples from the client. | |
| typedef bool | fpl_gamepad_mapping_resolver_callback(const fplGamepadInfo *info, fplGamepadMapping *outMapping, void *userData) |
| Optional callback invoked once per controller connect on raw-HID gamepad backends (DirectInput, Linux joystick/evdev, etc.) to install a custom fplGamepadMapping for the device. | |
| typedef void * | fpl_memory_allocate_callback(void *userData, const size_t size, const size_t alignment) |
| A function definition for a custom memory allocation callback. | |
| typedef void | fpl_memory_release_callback(void *userData, void *ptr) |
| A function definition for a custom memory release callback. | |
| typedef bool | fpl_window_event_callback(const fplPlatformType platformType, void *windowState, void *rawEventData, void *userData) |
| A function definition for a callback executed for each raw window event. | |
| typedef fpl_window_event_callback | fpl_window_exposed_callback |
| A function definition for a callback executed when the window needs to be exposed/repainted. | |
| typedef uint64_t | fplAudioFormatU64 |
| Encoded audio format in 64-bit ([63] Unused 8-bit, Type 8-bit, Channels 16-bit, Sample rate 32-bit [0]). | |
| typedef void | fplVulkanValidationLayerCallback(void *userData, const char *message, const uint32_t messageSeverity, const uint32_t messageType, const void *debugUtilsMessengerCallbackData) |
| A function definition for the debug callback that is called, when the validation layer writes something. | |
Functions | |
| fpl_common_api fplColor32 | fplCreateColorRGBA (const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t a) |
| Creates a 32-bit color structure from the specified R, G, B, A components. | |
| fpl_common_api const char * | fplGetAudioChannelTypeName (const fplAudioChannelType type) |
| Audio speaker layout operator overloads for C++. | |
| fpl_common_api const fplSettings * | fplGetCurrentSettings (void) |
| Gets the current settings. | |
| fpl_common_api void | fplInputBackendMaskDisable (fplInputBackendMask *mask, const fplInputBackendType type) |
| Clears the bit for the given backend type in the mask. | |
| fpl_common_api void | fplInputBackendMaskEnable (fplInputBackendMask *mask, const fplInputBackendType type) |
| Sets the bit for the given backend type in the mask. | |
| fpl_common_api bool | fplInputBackendMaskIsEnabled (const fplInputBackendMask *mask, const fplInputBackendType type) |
| Returns true when the given backend type bit is set in the mask. | |
| fpl_common_api fplSettings | fplMakeDefaultSettings (void) |
| Creates a full settings structure containing default values. | |
| fpl_common_api const char * | fplPlatformGetResultName (const fplPlatformResultType type) |
| Gets the string representation of a platform result type. | |
| fpl_common_api void | fplSetDefaultAudioSettings (fplAudioSettings *audio) |
| Resets the given audio settings to default settings (S16 PCM, 48 kHz, 2 Channels). | |
| fpl_common_api void | fplSetDefaultConsoleSettings (fplConsoleSettings *console) |
| Resets the given console settings container to default settings. | |
| fpl_common_api void | fplSetDefaultGamepadSettings (fplGamepadSettings *gamepadSettings) |
| Resets the given gamepad settings container to default values. | |
| fpl_common_api void | fplSetDefaultInputSettings (fplInputSettings *input) |
| Resets the given input settings container to default values. | |
| fpl_common_api void | fplSetDefaultSettings (fplSettings *settings) |
| Resets the given settings container to default values for window, video, audio, etc. | |
| fpl_common_api void | fplSetDefaultVideoSettings (fplVideoSettings *video) |
| Resets the given video settings to default values. | |
| fpl_common_api void | fplSetDefaultWindowSettings (fplWindowSettings *window) |
| Resets the given window settings container to default settings. | |
This category contains global settings structures/enumerations and functions to initialize/set them.
| #define FPL_GAMEPAD_MAPPING_RESOLVE_CALLBACK | ( | name | ) |
Defines a prototype for a gamepad mapping resolver function.
| [in] | name | The name of the function. |
Definition at line 6672 of file final_platform_layer.h.
| #define FPL_MAX_AUDIO_CHANNEL_COUNT |
Maximum number of audio channels.
Definition at line 6269 of file final_platform_layer.h.
| #define FPL_MAX_INPUT_BACKEND_COUNT |
Maximum number of input backends that can be active at once.
Definition at line 6752 of file final_platform_layer.h.
| typedef uint32_t fpl_audio_client_read_callback(const fplAudioFormat *deviceFormat, const uint32_t frameCount, void *outputSamples, void *userData) |
A function definition for a callback that is called to read audio samples from the client.
| [in] | deviceFormat | Reference to the source audio format structure fplAudioFormat. |
| [in] | frameCount | The number of frames the client should write at max. |
| [out] | outputSamples | Reference to the target samples. |
| [in] | userData | Reference to the user data specified in fplAudioSettings. |
Definition at line 6445 of file final_platform_layer.h.
| typedef bool fpl_gamepad_mapping_resolver_callback(const fplGamepadInfo *info, fplGamepadMapping *outMapping, void *userData) |
Optional callback invoked once per controller connect on raw-HID gamepad backends (DirectInput, Linux joystick/evdev, etc.) to install a custom fplGamepadMapping for the device.
| [in] | info | Backend-built description of the device that just connected. |
| [out] | outMapping | Mapping to fill in when the resolver wants to override the default convention. |
| [in] | userData | Opaque pointer the user supplied via fplGamepadSettings. |
outMapping for this device, false to fall back to the default convention. Definition at line 6683 of file final_platform_layer.h.
| typedef void * fpl_memory_allocate_callback(void *userData, const size_t size, const size_t alignment) |
A function definition for a custom memory allocation callback.
| [in] | userData | Reference to opaque user data. |
| [in] | size | The size to be allocated. |
| [in] | alignment | The alignment in bytes. |
Definition at line 6820 of file final_platform_layer.h.
| typedef void fpl_memory_release_callback(void *userData, void *ptr) |
A function definition for a custom memory release callback.
| [in] | userData | Reference to opaque user data. |
| [in] | ptr | Reference to the memory to be released. |
Definition at line 6827 of file final_platform_layer.h.
| typedef bool fpl_window_event_callback(const fplPlatformType platformType, void *windowState, void *rawEventData, void *userData) |
A function definition for a callback executed for each raw window event.
| [in] | platformType | The current platform type fplPlatformType. |
| [in,out] | windowState | Reference to the opaque window state, mapping to the actual internal window state. |
| [in] | rawEventData | Reference to the raw event data structure for the current OS (XEvent for POSIX, MSG for Win32, etc.). |
| [in] | userData | Reference to the specific user data specified in fplWindowCallbacks. |
Definition at line 6524 of file final_platform_layer.h.
A function definition for a callback executed when the window needs to be exposed/repainted.
| [in] | platformType | The current platform type fplPlatformType. |
| [in,out] | windowState | Reference to the opaque window state, mapping to internal window state. |
| [in] | rawEventData | Reference to the raw event data structure for the current OS (XEvent for POSIX, MSG for Win32, etc.). |
| [in] | userData | Reference to the specific user data specified in fplWindowCallbacks. |
Definition at line 6534 of file final_platform_layer.h.
| typedef uint64_t fplAudioFormatU64 |
Encoded audio format in 64-bit ([63] Unused 8-bit, Type 8-bit, Channels 16-bit, Sample rate 32-bit [0]).
Definition at line 6342 of file final_platform_layer.h.
| typedef void fplVulkanValidationLayerCallback(void *userData, const char *message, const uint32_t messageSeverity, const uint32_t messageType, const void *debugUtilsMessengerCallbackData) |
A function definition for the debug callback that is called, when the validation layer writes something.
| [in] | userData | Reference to opaque user data. |
| [in] | message | The message from the validation layer. |
| [in] | messageSeverity | The severity of the message. |
| [in] | messageType | The type of the message. |
| [in] | debugUtilsMessengerCallbackData | Reference to the debug utils messenger callback data. |
Definition at line 5915 of file final_platform_layer.h.
| enum fplAudioBackendType |
An enumeration of audio backend types.
| Enumerator | |
|---|---|
| fplAudioBackendType_None | No audio backend. |
| fplAudioBackendType_Auto | Auto detect audio backend. |
| fplAudioBackendType_DirectSound | DirectSound audio backend. |
| fplAudioBackendType_WASAPI | WASAPI audio backend. |
| fplAudioBackendType_Alsa | ALSA audio backend. |
| fplAudioBackendType_PulseAudio | PulseAudio audio backend. |
| fplAudioBackendType_PipeWire | PipeWire audio backend. |
| fplAudioBackendType_OSS | OSS audio backend. |
| fplAudioBackendType_First | First fplAudioBackendType. |
| fplAudioBackendType_Last | Last fplAudioBackendType. |
Definition at line 6025 of file final_platform_layer.h.
An enumeration of audio channel layouts.
Definition at line 6141 of file final_platform_layer.h.
| enum fplAudioChannelType |
An enumeration of audio channel types.
Definition at line 6178 of file final_platform_layer.h.
An enumeration of audio default fields.
Definition at line 6081 of file final_platform_layer.h.
| enum fplAudioFormatType |
An enumeration of audio format types.
| Enumerator | |
|---|---|
| fplAudioFormatType_None | No audio format. |
| fplAudioFormatType_U8 | Unsigned 8-bit integer PCM. |
| fplAudioFormatType_S16 | Signed 16-bit integer PCM. |
| fplAudioFormatType_S24 | Signed 24-bit integer PCM. |
| fplAudioFormatType_S32 | Signed 32-bit integer PCM. |
| fplAudioFormatType_S64 | Signed 64-bit integer PCM. |
| fplAudioFormatType_F32 | 32-bit IEEE_FLOAT. |
| fplAudioFormatType_F64 | 64-bit IEEE_FLOAT. |
| fplAudioFormatType_First | First fplAudioFormatType. |
| fplAudioFormatType_Last | Last fplAudioFormatType. |
Definition at line 6053 of file final_platform_layer.h.
| enum fplAudioLatencyType |
fplAudioDefaultFields operator overloads for C++.
An enumeration of audio latency types.
| Enumerator | |
|---|---|
| fplAudioLatencyType_Conservative | Conservative latency. |
| fplAudioLatencyType_Low | Low latency. |
Definition at line 6104 of file final_platform_layer.h.
| enum fplAudioMode |
An enumeration of audio modes that combines conservative/latency and exclusive/shared.
Definition at line 6126 of file final_platform_layer.h.
| enum fplAudioShareMode |
An enumeration of audio share modes.
| Enumerator | |
|---|---|
| fplAudioShareMode_Shared | Shared mode. |
| fplAudioShareMode_Exclusive | Exclusive mode. |
Definition at line 6115 of file final_platform_layer.h.
| enum fplImageType |
An enumeration of image types.
| Enumerator | |
|---|---|
| fplImageType_None | No image type. |
| fplImageType_RGBA | RGBA image type. |
Definition at line 6494 of file final_platform_layer.h.
| enum fplInitFlags |
An enumeration of initialization flags.
| Enumerator | |
|---|---|
| fplInitFlags_None | No init flags. |
| fplInitFlags_Console | Create a console window. |
| fplInitFlags_Window | Create a single window. |
| fplInitFlags_Video | Use a video backbuffer (This flag ensures that fplInitFlags_Window is included always). |
| fplInitFlags_Audio | Use asynchronous audio playback. |
| fplInitFlags_Gamepad | Enable the gamepad input source. Initializes the input subsystem if not already requested. |
| fplInitFlags_Keyboard | Enable the keyboard input source. Initializes the input subsystem if not already requested. |
| fplInitFlags_Mouse | Enable the mouse input source. Initializes the input subsystem if not already requested. |
| fplInitFlags_Input | Convenience alias enabling keyboard, mouse and gamepad input sources together. |
| fplInitFlags_All | All init flags. |
Definition at line 5770 of file final_platform_layer.h.
| enum fplInputBackendType |
InputSourceType operator overloads for C++.
Identifies a concrete input backend implementation.
Definition at line 6730 of file final_platform_layer.h.
| enum fplInputSourceType |
A bitmask of input source kinds (keyboard, mouse, gamepad).
Definition at line 6711 of file final_platform_layer.h.
An enumeration of dynamic memory allocation modes.
| Enumerator | |
|---|---|
| fplMemoryAllocationMode_Automatic | Use OS memory allocation. |
| fplMemoryAllocationMode_Custom | Use custom memory allocation. |
Definition at line 6833 of file final_platform_layer.h.
An enumeration of OpenGL compatibility flags.
Definition at line 5876 of file final_platform_layer.h.
An enumeration of platform result types.
| Enumerator | |
|---|---|
| fplPlatformResultType_FailedWindow | Window creation failed. |
| fplPlatformResultType_FailedAudio | Audio initialization failed. |
| fplPlatformResultType_FailedVideo | Video initialization failed. |
| fplPlatformResultType_FailedPlatform | Platform initialization failed. |
| fplPlatformResultType_OutOfMemory | Failed allocating required memory. |
| fplPlatformResultType_AlreadyInitialized | Platform is already initialized. |
| fplPlatformResultType_NotInitialized | Platform is not initialized. |
| fplPlatformResultType_Success | Everything is fine. |
| fplPlatformResultType_First | First fplPlatformResultType. |
| fplPlatformResultType_Last | Last fplPlatformResultType. |
Definition at line 5819 of file final_platform_layer.h.
| enum fplPlatformType |
InitFlags operator overloads for C++.
An enumeration of platform types.
| Enumerator | |
|---|---|
| fplPlatformType_Unknown | Unknown platform. |
| fplPlatformType_Windows | Windows platform. |
| fplPlatformType_Linux | Linux platform. |
| fplPlatformType_Unix | Unix platform. |
| fplPlatformType_First | First fplPlatformType. |
| fplPlatformType_Last | Last fplPlatformType. |
Definition at line 5799 of file final_platform_layer.h.
| enum fplVideoBackendType |
An enumeration of video backend types.
Definition at line 5855 of file final_platform_layer.h.
An enumeration of Vulkan validation layer modes.
Definition at line 5921 of file final_platform_layer.h.
An enumeration of Vulkan validation layer logging severity.
Definition at line 5934 of file final_platform_layer.h.
| fpl_common_api fplColor32 fplCreateColorRGBA | ( | const uint8_t | r, |
| const uint8_t | g, | ||
| const uint8_t | b, | ||
| const uint8_t | a ) |
Creates a 32-bit color structure from the specified R, G, B, A components.
| [in] | r | The red component in range of 0-255. |
| [in] | g | The green component in range of 0-255. |
| [in] | b | The blue component in range of 0-255. |
| [in] | a | The alpha component in range of 0-255. |
| fpl_common_api const char * fplGetAudioChannelTypeName | ( | const fplAudioChannelType | type | ) |
Audio speaker layout operator overloads for C++.
Gets the name of the specified audio channel type.
| [in] | type | Audio channel type enumeration value fplAudioChannelType. |
| fpl_common_api const fplSettings * fplGetCurrentSettings | ( | void | ) |
Gets the current settings.
| fpl_common_api void fplInputBackendMaskDisable | ( | fplInputBackendMask * | mask, |
| const fplInputBackendType | type ) |
Clears the bit for the given backend type in the mask.
| [in,out] | mask | Reference to the mask to modify. |
| [in] | type | The backend type to disable. |
| fpl_common_api void fplInputBackendMaskEnable | ( | fplInputBackendMask * | mask, |
| const fplInputBackendType | type ) |
Sets the bit for the given backend type in the mask.
| [in,out] | mask | Reference to the mask to modify. |
| [in] | type | The backend type to enable. |
| fpl_common_api bool fplInputBackendMaskIsEnabled | ( | const fplInputBackendMask * | mask, |
| const fplInputBackendType | type ) |
Returns true when the given backend type bit is set in the mask.
| [in] | mask | Reference to the mask to query. |
| [in] | type | The backend type to test. |
| fpl_common_api fplSettings fplMakeDefaultSettings | ( | void | ) |
Creates a full settings structure containing default values.
| fpl_common_api const char * fplPlatformGetResultName | ( | const fplPlatformResultType | type | ) |
Gets the string representation of a platform result type.
| [in] | type | The platform result type enumeration value fplPlatformResultType. |
| fpl_common_api void fplSetDefaultAudioSettings | ( | fplAudioSettings * | audio | ) |
Resets the given audio settings to default settings (S16 PCM, 48 kHz, 2 Channels).
| [out] | audio | Reference to the target audio settings structure fplAudioSettings. |
| fpl_common_api void fplSetDefaultConsoleSettings | ( | fplConsoleSettings * | console | ) |
Resets the given console settings container to default settings.
| [out] | console | Reference to the target structure fplConsoleSettings. |
| fpl_common_api void fplSetDefaultGamepadSettings | ( | fplGamepadSettings * | gamepadSettings | ) |
Resets the given gamepad settings container to default values.
| [out] | gamepadSettings | Reference to the target structure fplGamepadSettings. |
| fpl_common_api void fplSetDefaultInputSettings | ( | fplInputSettings * | input | ) |
Resets the given input settings container to default values.
| [out] | input | Reference to the target structure fplInputSettings. |
| fpl_common_api void fplSetDefaultSettings | ( | fplSettings * | settings | ) |
Resets the given settings container to default values for window, video, audio, etc.
| [out] | settings | Reference to the target structure fplSettings. |
| fpl_common_api void fplSetDefaultVideoSettings | ( | fplVideoSettings * | video | ) |
Resets the given video settings to default values.
| [out] | video | Reference to the target structure fplVideoSettings. |
| fpl_common_api void fplSetDefaultWindowSettings | ( | fplWindowSettings * | window | ) |
Resets the given window settings container to default settings.
| [out] | window | Reference to the target structure fplWindowSettings. |