-
Notifications
You must be signed in to change notification settings - Fork 13
final platform layer h File Reference
Final Platform Layer (FPL) - A C99 Single-Header-File Platform Abstraction Library. More...
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdarg.h>
#include <limits.h>
#include <assert.h>
#include <signal.h>
#include <malloc.h>
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <locale.h>
Go to the source code of this file.
| Type | Name |
|---|---|
| struct |
fplARMCPUCapabilities Container storing the capabilities of an ARM CPU. More... |
| 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 |
fplConditionVariable Stores the condition variable structure. More... |
| struct |
fplConsoleSettings Stores the title and options for the console. More... |
| struct |
fplCPUCapabilities Container storing the capabilities of a CPU. More... |
| union |
fplCPUIDLeaf Container representing the 4-registers for a CPU-Leaf (EAX, EBX, ECX, EDX). More... |
| struct |
fplDateTime Stores a date and time with milliseconds, including the UTC offset. More... |
| struct |
fplDateTimeCreationResult Stores the result of a date time creation. More... |
| struct |
fplDateTimeResult Stores the components for a date and time, that may be computed from a date time stamp. More... |
| struct |
fplDisplayInfo A struct containing information about a display. More... |
| struct |
fplDisplayMode A structure containing one set of display mode settings, such as size, refresh rate, etc. More... |
| struct |
fplDynamicLibraryHandle Stores the internal handle to a dynamic library. More... |
| union |
fplEndianess Byte-order probe union that overlays a 32-bit integer with its raw bytes. More... |
| struct |
fplEvent A structure containing event data for all event types (Window, Keyboard, Mouse, etc.). More... |
| struct |
fplFileEntry A structure containing the information for a file or directory (name, type, attributes, etc.). More... |
| struct |
fplFileHandle The file handle structure. More... |
| union |
fplFilePermissions fplFilePermissionMasks operator overloads for C++. More... |
| struct |
fplFileTimeStamps A structure containing timestamps for creation/access/modify date. More... |
| struct |
fplGamepadButton A structure containing properties for a gamepad button (IsDown, etc.). More... |
| struct |
fplGamepadData Backend-agnostic snapshot of raw device input that a fplGamepadMapping operates on. More... |
| struct |
fplGamepadEvent A structure containing gamepad event data (Type, Device, State, etc.). More... |
| struct |
fplGamepadInfo Read-only description of a controller passed to a fpl_gamepad_mapping_resolver_callback at connect time. More... |
| struct |
fplGamepadInputBinding Describes the raw input source bound to one logical FPL gamepad button or axis slot. More... |
| struct |
fplGamepadMapping A complete mapping of raw device inputs onto FPL's logical gamepad layout. More... |
| struct |
fplGamepadSettings Stores the settings for controlling how gamepads are handled. More... |
| struct |
fplGamepadState A structure containing the entire gamepad state, that defines a full gamepad state in XInput/XBox layout. More... |
| struct |
fplGamepadStates A struct containing the full state for all gamepad devices. 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 |
fplInputBackendSupport Describes the capabilities of a single input backend. More... |
| struct |
fplInputDevice Describes a single input device exposed by some backend. More... |
| struct |
fplInputDeviceGuid A 128-bit identifier uniquely identifying an input device across backends. More... |
| struct |
fplInputSettings Stores input settings. More... |
| union |
fplInternalConditionVariable Stores the internal condition variable for any platform. More... |
| union |
fplInternalDynamicLibraryHandle Stores the library handle for any platform. More... |
| union |
fplInternalFileEntryHandle FileAttributeFlags operator overloads for C++. More... |
| union |
fplInternalFileHandle A union containing the internal file handle for any platform. More... |
| struct |
fplInternalFileRootInfo A structure containing the internal root file information. More... |
| union |
fplInternalMutexHandle Stores the internal mutex handle for any platform. More... |
| union |
fplInternalSemaphoreHandle Stores the internal semaphore handle for any platform. More... |
| union |
fplInternalSignalHandle Stores the internal signal handle for any platform. More... |
| union |
fplInternalThreadHandle Stores the thread handle for any platform. More... |
| struct |
fplKeyboardEvent A structure containing keyboard event data (Type, Keycode, Mapped key, etc.). More... |
| struct |
fplKeyboardState A struct containing the full keyboard state. More... |
| struct |
fplLogSettings Stores log settings. More... |
| struct |
fplLogWriter Stores log writer settings. More... |
| struct |
fplLogWriterConsole Log writer flags enumeration operators. More... |
| struct |
fplLogWriterCustom Stores custom logging properties. More... |
| struct |
fplMemoryAllocationSettings Stores settings for memory allocation usage. More... |
| struct |
fplMemoryBlock Stores properties that represents any block of memory. More... |
| struct |
fplMemoryInfos Stores information about the current memory usage. More... |
| struct |
fplMemorySettings Stores memory settings for dynamic and temporary allocations. More... |
| struct |
fplMouseEvent A structure containing mouse event data (Type, Button, Position, etc.). More... |
| struct |
fplMouseState A struct containing the full mouse state. More... |
| struct |
fplMutexHandle Stores the mutex handle structure. More... |
| struct |
fplOpenGLSettings Stores OpenGL video settings. More... |
| struct |
fplOSVersionInfos Stores the version information for the operating system. More... |
| struct |
fplSemaphoreHandle Stores the semaphore handle structure. More... |
| struct |
fplSettings Stores settings, such as window, video, etc. More... |
| struct |
fplSignalHandle Stores the signal handle structure. More... |
| union |
fplSpecificAudioSettings Stores backend-specific audio settings. More... |
| struct |
fplThreadHandle Stores the thread handle structure. More... |
| struct |
fplThreadParameters Stores creation parameters for fplThreadCreateWithParameters(). More... |
| union |
fplTimestamp Stores a timestamp, used for delta measurements only. More... |
| struct |
fplVersionInfo Stores version information. More... |
| struct |
fplVideoBackBuffer A structure containing video backbuffer properties. More... |
| struct |
fplVideoRect A structure defining a video rectangle's position and size. More... |
| union |
fplVideoRequirements Stores the video requirements for the desired video backend. More... |
| struct |
fplVideoRequirementsVulkan Stores the requirements for the Vulkan video backend. More... |
| struct |
fplVideoSettings Stores video settings such as backend, v-sync, API-settings, etc. More... |
| struct |
fplVideoSurface Stores the surface properties for the active video backend. More... |
| struct |
fplVideoSurfaceOpenGL Stores the surface properties for the OpenGL video backend. More... |
| struct |
fplVideoSurfaceVulkan Stores the surface properties for the Vulkan video backend. More... |
| union |
fplVideoWindow Stores the video window handles. More... |
| struct |
fplVulkanSettings Stores Vulkan video settings. More... |
| struct |
fplWindowCallbacks Stores the window callbacks. More... |
| struct |
fplWindowDropFiles A structure containing number and dropped files information. More... |
| struct |
fplWindowEvent A structure containing window event data (Size, Position, etc.). 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... |
| struct |
fplX86CPUCapabilities Container storing the capabilities of an x86 CPU. More... |
| Type | Name |
|---|---|
| #define |
fpl_api API call. |
| #define |
FPL_APPTYPE_WINDOW Application is built as a windowed application (a window is created by FPL). |
| #define |
FPL_CACHELINE_SIZE Cacheline size for Default Architecture (64-bytes). |
| #define |
fpl_common_api Common API. |
| #define |
FPL_CPU_32BIT 32-bit CPU detected. |
| #define |
fpl_dllexport Link-library Export. |
| #define |
fpl_dllimport Link-library Import. |
| #define |
fpl_dlllocal Link-library Local. |
| #define |
FPL_ENUM_AS_FLAGS_OPERATORS(type) Defines bitwise operator overloads for the given enum type (C++ only, no-op in C). |
| #define |
fpl_extern External call. |
| #define |
fpl_extern_inline Extern inline function. |
| #define |
FPL_FILE_EXT_SEPARATOR File extension character. |
| #define |
fpl_force_inline Always inlines this function. |
| #define |
FPL_FUNCTION_NAME Function name macro. |
| #define |
FPL_GAMEPAD_BUTTON_COUNT Number of logical button slots stored in a fplGamepadMapping (matches fplGamepadButtonType). |
| #define |
FPL_GAMEPAD_DATA_MAX_AXES Maximum number of raw axes captured in a fplGamepadData snapshot. |
| #define |
FPL_GAMEPAD_DATA_MAX_BUTTONS Maximum number of raw buttons captured in a fplGamepadData snapshot. |
| #define |
FPL_GAMEPAD_DATA_MAX_HATS Maximum number of raw hats captured in a fplGamepadData snapshot. |
| #define |
FPL_GAMEPAD_GUID_SIZE Defines the size of a game controller GUID in bytes. |
| #define |
FPL_GAMEPAD_MAPPING_RESOLVE_CALLBACK(name) Defines a prototype for a gamepad mapping resolver function. |
| #define |
fpl_globalvar Global persistent variable. |
| #define |
fpl_inline Inline function. |
| #define |
fpl_internal Private/Internal function. |
| #define |
fpl_internal_inline Private/Internal inline function. |
| #define |
FPL_IS_IDE Is set when an IDE is active, like IntelliSense or JetBrains. |
| #define |
fpl_localvar Local persistent variable. |
| #define |
fpl_main Empty linkage marker for the user-defined main entry point. |
| #define |
FPL_MAX_AUDIO_CHANNEL_COUNT Maximum number of audio channels. |
| #define |
FPL_MAX_BUFFER_LENGTH Maximum length of an internal buffer (in bytes). |
| #define |
FPL_MAX_FILENAME_LENGTH Maximum length of a filename. |
| #define |
FPL_MAX_GAMEPAD_STATE_COUNT Max number of gamepad states. |
| #define |
FPL_MAX_INPUT_BACKEND_COUNT Maximum number of input backends that can be active at once. |
| #define |
FPL_MAX_INPUT_DEVICE_COUNT Maximum number of devices held by the input subsystem at once. |
| #define |
FPL_MAX_INPUT_DEVICE_NAME Maximum length of the fplInputDevice name field. |
| #define |
FPL_MAX_KEYBOARD_STATE_COUNT fplKeyboardModifierFlags operator overloads for C++. |
| #define |
FPL_MAX_NAME_LENGTH Maximum length of a name (in characters). |
| #define |
FPL_MAX_PATH_LENGTH Maximum length of a path. |
| #define |
FPL_MAX_VERSION_PART_LENGTH Maximum number of digits in a single version-number part (excluding NUL). |
| #define |
fpl_no_inline Prevents inlining of this function. |
| #define |
FPL_NOT_IMPLEMENTED Crashes the application via a null-pointer write. |
| #define |
fpl_null Defines a NULL pointer value that works in C/C++. |
| #define |
FPL_PATH_SEPARATOR Path separator character. |
| #define |
fpl_platform_api Platform API. |
| #define |
FPL_TIMEOUT_INFINITE Infinite timeout constant. |
| #define |
FPL_X86_CPU_INSTR_SET_LEVEL Compiled X86 CPU Instruction Set. |
| #define |
fplAlignAs(N) Structure alignment in bytes. |
| #define |
fplAlwaysAssert(exp) Always crashes the application with a null-pointer assignment when the specified expression evaluates to false. |
| #define |
fplArrayCount(arr) Returns the element count from a static array. |
| #define |
fplAsm An assembler keyword (asm) that is compiler-specific. |
| #define |
fplAssert(exp) Breaks with a runtime assertion when the specified expression evaluates to false. |
| #define |
fplAssertPtr(ptr) Breaks when the specified pointer is null. |
| #define |
fplClearStruct(ptr) Clears the given struct pointer to zero. |
| #define |
fplCopyStruct(src, dst) Copies the given source struct into the destination struct. |
| #define |
fplDebugBreak() Stops the debugger on this line always. |
| #define |
fplGetAlignedSize(size, alignment) Returns the given size, extended to satisfy the given alignment boundary. |
| #define |
fplGetAlignmentOffset(value, alignment) Returns the offset for the value to satisfy the given alignment boundary. |
| #define |
fplGetEndianess32() Returns the unsigned 32-bit integer value that represents the current platform endianness, built from the byte sequence (0, 1, 2, 3). |
| #define |
fplGigaBytes(value) Returns the number of bytes for the given gigabytes. |
| #define |
fplHasInclude(inc) Test for include existence. |
| #define |
fplIsAligned(ptr, alignment) Returns true when the given pointer address is aligned to the given alignment. |
| #define |
fplIsBigEndian() Gets a value indicating whether the current platform is big-endian or not. |
| #define |
fplIsBitSet(value, bit) Returns true when the given value has the given bit set. |
| #define |
fplIsLittleEndian() Gets a value indicating whether the current platform is little-endian or not. |
| #define |
fplIsMaskSet(value, mask) Returns true when the given mask is set in the value. |
| #define |
fplIsPowerOfTwo(value) Returns true when the given value is a power of two. |
| #define |
fplKiloBytes(value) Returns the number of bytes for the given kilobytes. |
| #define |
fplMax(a, b) Returns the biggest value of A and B. |
| #define |
fplMegaBytes(value) Returns the number of bytes for the given megabytes. |
| #define |
fplMin(a, b) Returns the smallest value of A and B. |
| #define |
fplMinAlignment Minimum structure alignment in bytes. |
| #define |
fplOffsetOf(type, field) Returns the offset in bytes for the specified structure type and field name. |
| #define |
fplStackAllocate(size) Manually allocate the number of specified bytes of memory on the stack. |
| #define |
fplStaticAssert(exp) Breaks the compilation when the specified expression evaluates to false. |
| #define |
fplStructField Defines a single field in a struct. |
| #define |
fplStructInit Initializes a struct by the given type. |
| #define |
fplStructSet Overwrites the value of the given struct to a new value. |
| #define |
fplTeraBytes(value) Returns the number of bytes for the given terabytes. |
| #define |
fplZeroInit Initializes a struct to zero. |
| Type | Name |
|---|---|
| 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 int32_t |
fpl_b32 Defines an integer-based boolean that has a width of 32-bit. |
| 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_log_func_callback(const char *funcName, const int lineNumber, const fplLogLevel level, const char *message) A function definition for a callback for printing a log message. |
| 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 void |
fpl_run_thread_callback(const fplThreadHandle *thread, void *data) A function definition for a callback to execute user code inside another thread. |
| 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 uint64_t |
fplFileTimeStamp The elapsed seconds since the UNIX epoch (1970-01-01 00:00:00). |
| typedef uint8_t |
fplGamepadGuid[FPL_GAMEPAD_GUID_SIZE] A typedef that defines a 16-byte GUID used to identify a game controller. |
| typedef char |
fplGamepadName[FPL_MAX_NAME_LENGTH] A typedef that defines the name of a game controller. |
| typedef uint64_t |
fplMilliseconds A type definition for milliseconds (64-bit). |
| typedef double |
fplSeconds A type definition for seconds (64-bit). |
| typedef uint32_t |
fplThreadState A type definition that maps fplThreadStates into a 32-bit integer for atomic storage. |
| typedef uint32_t |
fplTimeoutValue A type definition for a timeout value in milliseconds. |
| typedef char |
fplVersionNumberPart[FPL_MAX_VERSION_PART_LENGTH+1] A type definition for mapping a part of a version number. |
| 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. |
| Type | Name |
|---|---|
| fpl_common_api void * |
fplAtomicAddAndFetchPtr (volatile void **dest, const intptr_t addend) Adds the addend to destination pointer atomically and returns the result after the addition. |
| fpl_platform_api int32_t |
fplAtomicAddAndFetchS32 (volatile int32_t *dest, const int32_t addend) Adds the addend to destination 32-bit signed integer atomically and returns the result after the addition. |
| fpl_platform_api int64_t |
fplAtomicAddAndFetchS64 (volatile int64_t *dest, const int64_t addend) Adds the addend to destination 64-bit signed integer atomically and returns the result after the addition. |
| fpl_common_api size_t |
fplAtomicAddAndFetchSize (volatile size_t *dest, const size_t addend) Adds the addend to destination size atomically and returns the result after the addition. |
| fpl_platform_api uint32_t |
fplAtomicAddAndFetchU32 (volatile uint32_t *dest, const uint32_t addend) Adds the addend to destination 32-bit unsigned integer atomically and returns the result after the addition. |
| fpl_platform_api uint64_t |
fplAtomicAddAndFetchU64 (volatile uint64_t *dest, const uint64_t addend) Adds the addend to destination 64-bit unsigned integer atomically and returns the result after the addition. |
| fpl_common_api void * |
fplAtomicCompareAndSwapPtr (volatile void **dest, const void *comparand, const void *exchange) Compares a pointer with a comparand and swaps it when comparand matches the destination. |
| fpl_platform_api int32_t |
fplAtomicCompareAndSwapS32 (volatile int32_t *dest, const int32_t comparand, const int32_t exchange) Compares a 32-bit signed integer with a comparand and swaps it when comparand matches the destination. |
| fpl_platform_api int64_t |
fplAtomicCompareAndSwapS64 (volatile int64_t *dest, const int64_t comparand, const int64_t exchange) Compares a 64-bit signed integer with a comparand and swaps it when comparand matches the destination. |
| fpl_common_api size_t |
fplAtomicCompareAndSwapSize (volatile size_t *dest, const size_t comparand, const size_t exchange) Compares a size with a comparand and swaps it when comparand matches the destination. |
| fpl_platform_api uint32_t |
fplAtomicCompareAndSwapU32 (volatile uint32_t *dest, const uint32_t comparand, const uint32_t exchange) Compares a 32-bit unsigned integer with a comparand and swaps it when comparand matches the destination. |
| fpl_platform_api uint64_t |
fplAtomicCompareAndSwapU64 (volatile uint64_t *dest, const uint64_t comparand, const uint64_t exchange) Compares a 64-bit unsigned integer with a comparand and swaps it when comparand matches the destination. |
| fpl_common_api void * |
fplAtomicExchangePtr (volatile void **target, const void *value) Replaces a pointer with the given value atomically. |
| fpl_platform_api int32_t |
fplAtomicExchangeS32 (volatile int32_t *target, const int32_t value) Replaces a 32-bit signed integer with the given value atomically. |
| fpl_platform_api int64_t |
fplAtomicExchangeS64 (volatile int64_t *target, const int64_t value) Replaces a 64-bit signed integer with the given value atomically. |
| fpl_common_api size_t |
fplAtomicExchangeSize (volatile size_t *target, const size_t value) Replaces a size with the given value atomically. |
| fpl_platform_api uint32_t |
fplAtomicExchangeU32 (volatile uint32_t *target, const uint32_t value) Replaces a 32-bit unsigned integer with the given value atomically. |
| fpl_platform_api uint64_t |
fplAtomicExchangeU64 (volatile uint64_t *target, const uint64_t value) Replaces a 64-bit unsigned integer with the given value atomically. |
| fpl_common_api void * |
fplAtomicFetchAndAddPtr (volatile void **dest, const intptr_t addend) Adds a addend to the pointer atomically and returns the initial value before the add. |
| fpl_platform_api int32_t |
fplAtomicFetchAndAddS32 (volatile int32_t *value, const int32_t addend) Adds a 32-bit signed integer to the value by the given addend atomically. |
| fpl_platform_api int64_t |
fplAtomicFetchAndAddS64 (volatile int64_t *value, const int64_t addend) Adds a 64-bit signed integer to the value by the given addend atomically. |
| fpl_common_api size_t |
fplAtomicFetchAndAddSize (volatile size_t *dest, const size_t addend) Adds a size to the value by the given addend atomically. |
| fpl_platform_api uint32_t |
fplAtomicFetchAndAddU32 (volatile uint32_t *value, const uint32_t addend) Adds a 32-bit unsigned integer to the value by the given addend atomically. |
| fpl_platform_api uint64_t |
fplAtomicFetchAndAddU64 (volatile uint64_t *value, const uint64_t addend) Adds a 64-bit unsigned integer to the value by the given addend atomically. |
| fpl_common_api void * |
fplAtomicIncrementPtr (volatile void **dest) Increments/Advances the given pointer by one atomically. |
| fpl_platform_api int32_t |
fplAtomicIncrementS32 (volatile int32_t *dest) Increments the given 32-bit signed integer by one atomically. |
| fpl_platform_api int64_t |
fplAtomicIncrementS64 (volatile int64_t *dest) Increments the given 64-bit signed integer by one atomically. |
| fpl_common_api size_t |
fplAtomicIncrementSize (volatile size_t *dest) Increments the given size by one atomically. |
| fpl_platform_api uint32_t |
fplAtomicIncrementU32 (volatile uint32_t *dest) Increments the given 32-bit unsigned integer by one atomically. |
| fpl_platform_api uint64_t |
fplAtomicIncrementU64 (volatile uint64_t *dest) Increments the given 64-bit unsigned integer by one atomically. |
| fpl_common_api bool |
fplAtomicIsCompareAndSwapPtr (volatile void **dest, const void *comparand, const void *exchange) Compares a pointer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result. |
| fpl_platform_api bool |
fplAtomicIsCompareAndSwapS32 (volatile int32_t *dest, const int32_t comparand, const int32_t exchange) Compares a 32-bit signed integer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result. |
| fpl_platform_api bool |
fplAtomicIsCompareAndSwapS64 (volatile int64_t *dest, const int64_t comparand, const int64_t exchange) Compares a 64-bit signed integer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result. |
| fpl_common_api bool |
fplAtomicIsCompareAndSwapSize (volatile size_t *dest, const size_t comparand, const size_t exchange) Compares a size with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result. |
| fpl_platform_api bool |
fplAtomicIsCompareAndSwapU32 (volatile uint32_t *dest, const uint32_t comparand, const uint32_t exchange) Compares a 32-bit unsigned integer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result. |
| fpl_platform_api bool |
fplAtomicIsCompareAndSwapU64 (volatile uint64_t *dest, const uint64_t comparand, const uint64_t exchange) Compares a 64-bit unsigned integer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result. |
| fpl_common_api void * |
fplAtomicLoadPtr (volatile void **source) Loads the pointer value atomically and returns the value. |
| fpl_platform_api int32_t |
fplAtomicLoadS32 (volatile int32_t *source) Loads the 32-bit signed value atomically and returns the value. |
| fpl_platform_api int64_t |
fplAtomicLoadS64 (volatile int64_t *source) Loads the 64-bit signed value atomically and returns the value. |
| fpl_common_api size_t |
fplAtomicLoadSize (volatile size_t *source) Loads the size value atomically and returns the value. |
| fpl_platform_api uint32_t |
fplAtomicLoadU32 (volatile uint32_t *source) Loads the 32-bit unsigned value atomically and returns the value. |
| fpl_platform_api uint64_t |
fplAtomicLoadU64 (volatile uint64_t *source) Loads the 64-bit unsigned value atomically and returns the value. |
| fpl_platform_api void |
fplAtomicReadFence (void) Inserts a memory read fence/barrier. |
| fpl_platform_api void |
fplAtomicReadWriteFence (void) Inserts a memory read and write fence/barrier. |
| fpl_common_api void |
fplAtomicStorePtr (volatile void **dest, const void *value) Overwrites the pointer value atomically. |
| fpl_platform_api void |
fplAtomicStoreS32 (volatile int32_t *dest, const int32_t value) Overwrites the 32-bit signed value atomically. |
| fpl_platform_api void |
fplAtomicStoreS64 (volatile int64_t *dest, const int64_t value) Overwrites the 64-bit signed value atomically. |
| fpl_common_api void |
fplAtomicStoreSize (volatile size_t *dest, const size_t value) Overwrites the size value atomically. |
| fpl_platform_api void |
fplAtomicStoreU32 (volatile uint32_t *dest, const uint32_t value) Overwrites the 32-bit unsigned value atomically. |
| fpl_platform_api void |
fplAtomicStoreU64 (volatile uint64_t *dest, const uint64_t value) Overwrites the 64-bit unsigned value atomically. |
| fpl_platform_api void |
fplAtomicWriteFence (void) Inserts a memory write fence/barrier. |
| fpl_common_api fplAudioResultType |
fplAudioInit (fplAudioSettings *audioSettings) Re/Initializes the audio system with the specified audio settings. |
| fpl_common_api bool |
fplAudioRelease (void) Unloads/Releases the audio system. |
| fpl_common_api size_t |
fplChangeFileExtension (const char *filePath, const char *newFileExtension, char *destPath, const size_t maxDestLen) Changes the file extension on the given source path and writes the result into a destination buffer. |
| fpl_platform_api bool |
fplConditionBroadcast (fplConditionVariable *condition) Wakes up all threads that wait on the given condition. |
| fpl_platform_api void |
fplConditionDestroy (fplConditionVariable *condition) Releases the given condition and clears the structure to zero. |
| fpl_platform_api bool |
fplConditionInit (fplConditionVariable *condition) Initializes the given condition. |
| fpl_platform_api bool |
fplConditionSignal (fplConditionVariable *condition) Wakes up one thread that waits on the given condition. |
| fpl_platform_api bool |
fplConditionWait (fplConditionVariable *condition, fplMutexHandle *mutex, const fplTimeoutValue timeout) Sleeps on the given condition and releases the mutex when done. |
| fpl_platform_api void |
fplConsoleError (const char *text) Writes the given text to the standard error console buffer. |
| fpl_common_api void |
fplConsoleFormatError (const char *format,...) Writes the given formatted text to the standard error console buffer. |
| fpl_common_api void |
fplConsoleFormatOut (const char *format,...) Writes the given formatted text to the standard output console buffer. |
| fpl_platform_api void |
fplConsoleOut (const char *text) Writes the given text to the standard output console buffer. |
| fpl_platform_api char |
fplConsoleWaitForCharInput (void) Waits for a character to be typed in the console input and returns it. |
| fpl_common_api size_t |
fplCopyString (const char *source, char *dest, const size_t maxDestLen) Copies the given source string into a destination string. |
| fpl_common_api size_t |
fplCopyStringLen (const char *source, const size_t sourceLen, char *dest, const size_t maxDestLen) Copies the given source string with a constrained length into a destination string. |
| fpl_platform_api fplCPUArchType |
fplCPUGetArchitecture (void) Gets the processor architecture type. |
| fpl_common_api const char * |
fplCPUGetArchName (const fplCPUArchType type) Gets the string representation of the given architecture type. |
| fpl_common_api bool |
fplCPUGetCapabilities (fplCPUCapabilities *outCaps) Gets the capabilities of the processor. |
| fpl_platform_api size_t |
fplCPUGetCoreCount (void) Retrieves the total number of processor cores. |
| fpl_common_api size_t |
fplCPUGetName (char *destBuffer, const size_t maxDestBufferLen) Retrieves the name of the processor. |
| fpl_common_api bool |
fplCPUID (const uint32_t functionId, fplCPUIDLeaf *outLeaf) Queries the x86 CPUID leaf register (EAX, EBX, ECX, EDX) for the given function id. |
| fpl_common_api uint64_t |
fplCPURDTSC (void) Reads the current time stamp counter (RDTSC). |
| fpl_common_api uint64_t |
fplCPUXCR0 (void) Gets the x86 extended control register for index zero. |
| fpl_common_api fplAudioMode |
fplCreateAudioMode (const fplAudioLatencyType latencyType, const fplAudioShareMode shareMode) Creates an audio mode from the specified audio latency type and share mode. |
| 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 fplVideoRect |
fplCreateVideoRectFromLTRB (int32_t left, int32_t top, int32_t right, int32_t bottom) Makes a video rectangle from a LTRB rectangle. |
| fpl_common_api fplDateTimeCreationResult |
fplDateTimeCreate (const uint16_t year, const uint8_t month, const uint8_t day, const uint8_t hour, const uint8_t minute, const uint8_t second, const uint16_t millisecond, const int32_t utcOffset) Creates a date time from the specified date time components and UTC offset. |
| fpl_platform_api fplDateTime |
fplDateTimeQuery (const fplDateTimeType type) Gets the current date and time in the specified format (UTC or local). |
| fpl_common_api void |
fplDebugFormatOut (const char *format,...) Writes the given formatted text into the debugger output stream. |
| fpl_platform_api void |
fplDebugOut (const char *text) Writes the given text into the debugger output stream. |
| fpl_common_api bool |
fplDecodeAudioFormatU64 (const fplAudioFormatU64 format64, uint32_t *outSampleRate, uint16_t *outChannels, fplAudioFormatType *outType) Decodes the specified encoded audio format to the specified sample rate, channels, and type. |
| fpl_platform_api bool |
fplDirectoriesCreate (const char *path) Creates all the directories in the given path. |
| fpl_platform_api bool |
fplDirectoryExists (const char *path) Checks if the given directory exists and returns a boolean indicating its existence. |
| fpl_platform_api bool |
fplDirectoryListBegin (const char *path, const char *filter, fplFileEntry *entry) Iterates through files/directories in the given directory. |
| fpl_platform_api void |
fplDirectoryListEnd (fplFileEntry *entry) Releases opened resources from iterating through files/directories. |
| fpl_platform_api bool |
fplDirectoryListNext (fplFileEntry *entry) Gets the next file entry from iterating through files/directories. |
| fpl_platform_api bool |
fplDirectoryRemove (const char *path) Deletes the given empty directory without confirmation and returns true when the deletion was successful. |
| fpl_platform_api bool |
fplDisableWindowFullscreen (void) Switches the window back to window mode. |
| fpl_platform_api bool |
fplDynamicLibraryLoad (const char *libraryFilePath, fplDynamicLibraryHandle *outHandle) Loads a dynamic library and returns if the load was successful or not. |
| fpl_platform_api void |
fplDynamicLibraryUnload (fplDynamicLibraryHandle *handle) Unloads the loaded library and resets the handle to zero. |
| fpl_platform_api bool |
fplEnableWindowFullscreen (void) Enables fullscreen mode on the nearest display. |
| fpl_common_api fplAudioFormatU64 |
fplEncodeAudioFormatU64 (const uint32_t sampleRate, const uint16_t channels, const fplAudioFormatType type) Creates an encoded audio format from the specified sample rate, channels, and type. |
| fpl_common_api size_t |
fplEnforcePathSeparator (char *path) Ensures that the given string always ends with a path separator. |
| fpl_common_api size_t |
fplEnforcePathSeparatorLen (char *path, size_t maxPathLen) Ensures that the given string always ends with a path separator with length constrained. |
| fpl_common_api void |
fplErrorsClear (void) Clears all the current errors in the platform. |
| fpl_common_api const char * |
fplExtractFileExtension (const char *sourcePath) Extracts the file extension from the given source path. |
| fpl_common_api const char * |
fplExtractFileName (const char *sourcePath) Extracts the file name including the file extension from the given source path. |
| fpl_common_api size_t |
fplExtractFilePath (const char *sourcePath, char *destPath, const size_t maxDestLen) Extracts the directory path from the given file path. |
| fpl_platform_api bool |
fplFileAppendBinary (const char *filePath, fplFileHandle *outHandle) Creates or appends a binary file by the given string path and returns the handle of it. |
| fpl_platform_api void |
fplFileClose (fplFileHandle *fileHandle) Closes the given file and releases the underlying resources and clears the handle to zero. |
| fpl_platform_api bool |
fplFileCopy (const char *sourceFilePath, const char *targetFilePath, const bool overwrite) Copies the given source file to the target path and returns true when the copy was successful. |
| fpl_platform_api bool |
fplFileCreateBinary (const char *filePath, fplFileHandle *outHandle) Creates a binary file for writing to the given string path and returns the handle of it. |
| fpl_platform_api bool |
fplFileDelete (const char *filePath) Deletes the given file without confirmation and returns true when the deletion was successful. |
| fpl_platform_api bool |
fplFileExists (const char *filePath) Checks if the file exists and returns a boolean indicating the existence. |
| fpl_platform_api bool |
fplFileFlush (fplFileHandle *fileHandle) Flushes the buffers of the given file and causes all buffered data to be written to a file. |
| fpl_common_api size_t |
fplFileGetPosition (const fplFileHandle *fileHandle) Gets the current file position in bytes. |
| fpl_platform_api uint32_t |
fplFileGetPosition32 (const fplFileHandle *fileHandle) Gets the current file position in bytes. |
| fpl_platform_api uint64_t |
fplFileGetPosition64 (const fplFileHandle *fileHandle) Gets the current file position in bytes. |
| fpl_common_api size_t |
fplFileGetSizeFromHandle (const fplFileHandle *fileHandle) Gets the file size in bytes for an opened file. |
| fpl_platform_api uint32_t |
fplFileGetSizeFromHandle32 (const fplFileHandle *fileHandle) Gets the file size in bytes for an opened file. |
| fpl_platform_api uint64_t |
fplFileGetSizeFromHandle64 (const fplFileHandle *fileHandle) Gets the file size in bytes for an opened file. |
| fpl_platform_api size_t |
fplFileGetSizeFromPath (const char *filePath) Gets the file size in bytes for the given file. |
| fpl_platform_api uint32_t |
fplFileGetSizeFromPath32 (const char *filePath) Gets the file size in bytes for the given file. |
| fpl_platform_api uint64_t |
fplFileGetSizeFromPath64 (const char *filePath) Gets the file size in bytes for the given file. |
| fpl_platform_api bool |
fplFileGetTimestampsFromHandle (const fplFileHandle *fileHandle, fplFileTimeStamps *outStamps) Gets the timestamps for an opened file. |
| fpl_platform_api bool |
fplFileGetTimestampsFromPath (const char *filePath, fplFileTimeStamps *outStamps) Gets the timestamps for the given file. |
| fpl_platform_api bool |
fplFileMove (const char *sourceFilePath, const char *targetFilePath) Moves the given source file to the target file and returns true when the move was successful. |
| fpl_platform_api bool |
fplFileOpenBinary (const char *filePath, fplFileHandle *outHandle) Opens a binary file for reading from a string path and returns the handle of it. |
| fpl_platform_api size_t |
fplFileReadBlock (const fplFileHandle *fileHandle, const size_t sizeToRead, void *targetBuffer, const size_t maxTargetBufferSize) Reads a block from the given file and returns the number of bytes read. |
| fpl_platform_api uint32_t |
fplFileReadBlock32 (const fplFileHandle *fileHandle, const uint32_t sizeToRead, void *targetBuffer, const uint32_t maxTargetBufferSize) Reads a block from the given file and returns the number of bytes read. |
| fpl_platform_api uint64_t |
fplFileReadBlock64 (const fplFileHandle *fileHandle, const uint64_t sizeToRead, void *targetBuffer, const uint64_t maxTargetBufferSize) Reads a block from the given file and returns the number of bytes read. |
| fpl_common_api size_t |
fplFileSetPosition (const fplFileHandle *fileHandle, const intptr_t position, const fplFilePositionMode mode) Sets the current file position by the given position, depending on the mode it's absolute or relative. |
| fpl_platform_api uint32_t |
fplFileSetPosition32 (const fplFileHandle *fileHandle, const int32_t position, const fplFilePositionMode mode) Sets the current file position by the given position, depending on the mode it's absolute or relative. |
| fpl_platform_api uint64_t |
fplFileSetPosition64 (const fplFileHandle *fileHandle, const int64_t position, const fplFilePositionMode mode) Sets the current file position by the given position, depending on the mode it's absolute or relative. |
| fpl_platform_api bool |
fplFileTryGetSizeFromHandle (const fplFileHandle *fileHandle, uint64_t *outSize) Tries to get the full 64-bit file size in bytes for an opened file, distinguishing a zero-byte file from an error. |
| fpl_platform_api bool |
fplFileTryGetSizeFromPath (const char *filePath, uint64_t *outSize) Tries to get the full 64-bit file size in bytes for the given file, distinguishing a zero-byte file from an error. |
| fpl_common_api size_t |
fplFileWriteBlock (const fplFileHandle *fileHandle, const void *sourceBuffer, const size_t sourceSize) Writes a block to the given file and returns the number of written bytes. |
| fpl_platform_api uint32_t |
fplFileWriteBlock32 (const fplFileHandle *fileHandle, const void *sourceBuffer, const uint32_t sourceSize) Writes a block to the given file and returns the number of written bytes. |
| fpl_platform_api uint64_t |
fplFileWriteBlock64 (const fplFileHandle *fileHandle, const void *sourceBuffer, const uint64_t sourceSize) Writes a block to the given file and returns the number of written bytes. |
| fpl_common_api bool |
fplFindInputDevice (const fplInputDeviceGuid *guid, fplInputDevice *outDevice) Looks up a single device by its GUID. |
| fpl_platform_api fplDateTimeResult |
fplFormatDateTime (const fplDateTime dateTime, const fplDateTimeType type) Formats the date time into the specified format as a fplDateTimeResult. |
| fpl_common_api bool |
fplGamepadMappingApply (const fplGamepadMapping *mapping, const fplGamepadData *input, fplGamepadState *outState) Applies a fplGamepadMapping over a raw device snapshot and writes the result into outState. |
| fpl_common_api bool |
fplGamepadMappingApplyDefault (const fplGamepadData *input, fplGamepadState *outState) Applies the built-in default convention to a raw device snapshot when no mapping is installed. |
| fpl_common_api const char * |
fplGetAudioBackendName (const fplAudioBackendType backendType) Gets the string that represents the given audio backend type. |
| fpl_common_api fplAudioBackendType |
fplGetAudioBackendType (void) Gets the current audio backend type. |
| fpl_common_api uint32_t |
fplGetAudioBufferSizeInBytes (const fplAudioFormatType format, const uint16_t channelCount, const uint32_t frameCount) Computes the total number of bytes for the buffer and the given parameters. |
| fpl_common_api uint32_t |
fplGetAudioBufferSizeInFrames (const uint32_t sampleRate, const uint32_t bufferSizeInMilliSeconds) Computes the total number of frames for a given sample rate and buffer size. |
| fpl_common_api uint32_t |
fplGetAudioBufferSizeInMilliseconds (const uint32_t sampleRate, const uint32_t frameCount) Computes the duration in milliseconds for the given sample rate and frame count. |
| fpl_common_api bool |
fplGetAudioChannelMap (fplAudioChannelMap *outMapping) Gets the audio channels mapping table. |
| fpl_common_api uint16_t |
fplGetAudioChannelsFromLayout (const fplAudioChannelLayout channelLayout) Returns the number of channels from the specified audio channel layout. |
| fpl_common_api const char * |
fplGetAudioChannelTypeName (const fplAudioChannelType type) Audio speaker layout operator overloads for C++. |
| fpl_common_api bool |
fplGetAudioDeviceInfo (const fplAudioDeviceID *deviceId, fplAudioDeviceInfo *outDeviceInfo) Gets the audio device info for the specified audio device ID. |
| fpl_common_api uint32_t |
fplGetAudioDevices (const uint32_t maxDeviceCount, const uint32_t deviceInfoSize, fplAudioDeviceInfo *outDevices) Retrieves all playback audio devices. |
| fpl_common_api const char * |
fplGetAudioFormatName (const fplAudioFormatType format) Gets the string that represents the given audio format type. |
| fpl_common_api uint32_t |
fplGetAudioFrameSizeInBytes (const fplAudioFormatType format, const uint16_t channelCount) Computes the number of bytes required for one interleaved audio frame - containing all the channels. |
| fpl_common_api bool |
fplGetAudioHardwareDevice (fplAudioDeviceInfo *outDevice) Retrieves the audio device info for the current audio device. |
| fpl_common_api const char * |
fplGetAudioHardwareDeviceName (void) Retrieves the audio device name for the current audio device. |
| fpl_common_api bool |
fplGetAudioHardwareFormat (fplAudioFormat *outFormat) Retrieves the native audio format for the current audio device. |
| fpl_common_api fplAudioLatencyType |
fplGetAudioLatencyType (const fplAudioMode mode) Gets the audio latency type from the specified audio mode. |
| fpl_common_api uint32_t |
fplGetAudioSampleSizeInBytes (const fplAudioFormatType format) Computes the number of bytes required to write one sample with one channel. |
| fpl_common_api fplAudioShareMode |
fplGetAudioShareMode (const fplAudioMode mode) Gets the audio share mode from the specified audio mode. |
| fpl_common_api size_t |
fplGetAvailableThreadCount (void) Gets the number of available threads. |
| fpl_platform_api bool |
fplGetClipboardText (char *dest, const uint32_t maxDestLen) Retrieves the current clipboard text. |
| fpl_common_api const char * |
fplGetCPUCapabilitiesTypeName (const fplCPUCapabilitiesType type) Gets the name of the specified fplCPUCapabilitiesType. |
| fpl_common_api const fplSettings * |
fplGetCurrentSettings (void) Gets the current settings. |
| fpl_platform_api uint64_t |
fplGetCurrentThreadId (void) Gets the thread id for the current thread. |
| fpl_common_api fplAudioChannelLayout |
fplGetDefaultAudioChannelLayoutFromChannels (const uint16_t channelCount) Returns the default audio channel layout from the specified channel count. |
| fpl_platform_api size_t |
fplGetDisplayCount (void) Gets the number of active displays. |
| fpl_platform_api bool |
fplGetDisplayFromPosition (const int32_t x, const int32_t y, fplDisplayInfo *outInfo) Finds the display from a cursor position and retrieves the information for it. |
| fpl_platform_api size_t |
fplGetDisplayModes (const char *id, fplDisplayMode *outModes, const size_t maxDisplayModeCount) Gets the information about the available display modes for the given display id. |
| fpl_platform_api size_t |
fplGetDisplays (fplDisplayInfo *outDisplays, const size_t maxDisplayCount) Gets information about all active displays. |
| fpl_platform_api void * |
fplGetDynamicLibraryProc (const fplDynamicLibraryHandle *handle, const char *name) Returns the dynamic library procedure address for the given procedure name. |
| fpl_common_api const char * |
fplGetErrorByIndex (const size_t index) Gets the last error string from the given index. |
| fpl_common_api size_t |
fplGetErrorCount (void) Gets the count of total last errors. |
| fpl_platform_api size_t |
fplGetExecutableFilePath (char *destPath, const size_t maxDestLen) Gets the full path to this executable, including the executable file name. |
| fpl_common_api uint32_t |
fplGetGamepadDevices (fplInputDevice *outDevices, const uint32_t maxDevices) Convenience wrapper that returns devices with fplInputSourceType_Gamepad. |
| fpl_platform_api size_t |
fplGetHomePath (char *destPath, const size_t maxDestLen) Gets the full path to your home directory. |
| fpl_common_api uint32_t |
fplGetInputBackendSupport (fplInputBackendSupport *outSupports, const uint32_t maxCount) Writes capabilities of all known input backends into outSupports. |
| fpl_common_api bool |
fplGetInputBackendSupportByType (const fplInputBackendType type, fplInputBackendSupport *outSupport) Looks up the support descriptor for a single backend type. |
| fpl_common_api uint32_t |
fplGetInputDevices (const fplInputSourceType sourceFilter, fplInputDevice *outDevices, const uint32_t maxDevices) Enumerates all input devices currently known to the input subsystem. |
| fpl_platform_api size_t |
fplGetInputLocale (const fplLocaleFormat targetFormat, char *buffer, const size_t maxBufferLen) Gets the input locale in the given target format. |
| fpl_common_api uint32_t |
fplGetKeyboardDevices (fplInputDevice *outDevices, const uint32_t maxDevices) Convenience wrapper that returns devices with fplInputSourceType_Keyboard. |
| fpl_common_api const char * |
fplGetLastError (void) Gets the last internal error string. |
| fpl_common_api const fplLogSettings * |
fplGetLogSettings (void) Gets the current log settings. |
| fpl_common_api const fplThreadHandle * |
fplGetMainThread (void) Gets the thread handle for the main thread. |
| fpl_common_api fplLogLevel |
fplGetMaxLogLevel (void) Gets the current maximum allowed log level. |
| fpl_common_api uint32_t |
fplGetMouseDevices (fplInputDevice *outDevices, const uint32_t maxDevices) Convenience wrapper that returns devices with fplInputSourceType_Mouse. |
| fpl_common_api const char * |
fplGetPlatformName (const fplPlatformType type) Gets the string representation of the given platform type. |
| fpl_common_api fplPlatformResultType |
fplGetPlatformResult (void) Gets the result type of the platform initialization. |
| fpl_common_api fplPlatformType |
fplGetPlatformType (void) Gets the type of the platform. |
| fpl_platform_api bool |
fplGetPrimaryDisplay (fplDisplayInfo *outInfo) Gets information about the primary display. |
| fpl_common_api size_t |
fplGetStringLength (const char *str) Counts the number of characters without including the zero terminator. |
| fpl_platform_api size_t |
fplGetSystemLocale (const fplLocaleFormat targetFormat, char *buffer, const size_t maxBufferLen) Gets the system locale in the given target format. |
| fpl_common_api uint32_t |
fplGetTargetAudioFrameCount (const uint32_t inputFrameCount, const uint32_t inputSampleRate, const uint32_t outputSampleRate) Computes the target number of audio frames from the specified input frame count and sample rate and the output sample rate. |
| fpl_platform_api fplThreadPriority |
fplGetThreadPriority (fplThreadHandle *thread) Retrieves the current thread priority from the OS for the given thread handle. |
| fpl_common_api fplThreadState |
fplGetThreadState (fplThreadHandle *thread) Gets the current thread state for the given thread. |
| fpl_common_api size_t |
fplGetUsedThreadCount (void) Gets the number of used/active threads. |
| fpl_platform_api size_t |
fplGetUserLocale (const fplLocaleFormat targetFormat, char *buffer, const size_t maxBufferLen) Gets the user locale in the given target format. |
| fpl_common_api fplVideoBackBuffer * |
fplGetVideoBackBuffer (void) Retrieves the pointer to the current video backbuffer. |
| fpl_common_api const char * |
fplGetVideoBackendName (fplVideoBackendType backendType) Gets a string that represents the given video backend. |
| fpl_common_api fplVideoBackendType |
fplGetVideoBackendType (void) Gets the current video backend. |
| fpl_common_api const void * |
fplGetVideoProcedure (const char *procName) Gets the procedure by the specified name from the active video backend. |
| fpl_common_api bool |
fplGetVideoRequirements (const fplVideoBackendType backendType, fplVideoRequirements *requirements) Gets the video requirements for the specified video backend. |
| fpl_common_api const fplVideoSurface * |
fplGetVideoSurface (void) Gets the current video surface that stores all handles used for the active video backend. |
| fpl_platform_api bool |
fplGetWindowDisplay (fplDisplayInfo *outInfo) Gets information about the display for the FPL window. |
| fpl_platform_api bool |
fplGetWindowPosition (fplWindowPosition *outPos) Retrieves the absolute window position. |
| fpl_platform_api bool |
fplGetWindowSize (fplWindowSize *outSize) Retrieves the inner window size. |
| fpl_platform_api fplWindowState |
fplGetWindowState (void) Gets the current window state. |
| fpl_common_api size_t |
fplGetWindowTitle (char *outTitle, const size_t maxOutTitleLength) Retrieves the window title and writes it into the output string. |
| 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 bool |
fplIsPlatformInitialized (void) Gets a value indicating whether the platform is initialized. |
| fpl_common_api bool |
fplIsStringEqual (const char *a, const char *b) Compares two strings and returns a boolean indicating the equality. |
| fpl_common_api bool |
fplIsStringEqualLen (const char *a, const size_t aLen, const char *b, const size_t bLen) Compares two strings with constrained lengths and returns a boolean indicating the equality. |
| fpl_common_api bool |
fplIsStringMatchWildcard (const char *source, const char *wildcard) Matches the given string by the given wildcard and returns a boolean indicating the match. |
| fpl_platform_api bool |
fplIsWindowDecorated (void) Gets the window decorated state as boolean. |
| fpl_platform_api bool |
fplIsWindowFloating (void) Gets the window floating state as boolean. |
| fpl_platform_api bool |
fplIsWindowFullscreen (void) Gets the window fullscreen state as boolean. |
| fpl_platform_api bool |
fplIsWindowResizable (void) Gets the window resizable state as boolean. |
| fpl_platform_api bool |
fplIsWindowRunning (void) Gets the window running state as a boolean. |
| fpl_common_api const char * |
fplKeyGetName (const fplKey key) Gets the string representation of the given key. |
| fpl_common_api fplSettings |
fplMakeDefaultSettings (void) Creates a full settings structure containing default values. |
| fpl_common_api void * |
fplMemoryAlignedAllocate (const size_t size, const size_t alignment) Allocates aligned memory from the operating system by the given alignment. |
| fpl_common_api void |
fplMemoryAlignedFree (void *ptr) Releases the aligned memory allocated from the operating system. |
| fpl_platform_api void * |
fplMemoryAllocate (const size_t size) Allocates memory from the operating system by the given size, that is aligned to the operating systems page-size (most common is 64 KB). |
| fpl_common_api void |
fplMemoryClear (void *mem, const size_t size) Clears the given memory by the given size to zero. |
| fpl_common_api void |
fplMemoryCopy (const void *sourceMem, const size_t sourceSize, void *targetMem) Copies the given source memory with its length to the target memory. |
| fpl_platform_api void |
fplMemoryFree (void *ptr) Releases the memory allocated from the operating system. |
| fpl_platform_api bool |
fplMemoryGetUsage (fplMemoryInfos *outInfos) Retrieves the current system memory usage. |
| fpl_common_api void |
fplMemorySet (void *mem, const uint8_t value, const size_t size) Sets the given memory by the given size to the given value. |
| fpl_platform_api fplMilliseconds |
fplMillisecondsQuery (void) Gets the current system clock in milliseconds, since some fixed starting point (OS start, System start, etc.), used for time delta measurements only. |
| fpl_platform_api void |
fplMutexDestroy (fplMutexHandle *mutex) Releases the given mutex and clears the structure to zero. |
| fpl_platform_api bool |
fplMutexInit (fplMutexHandle *mutex) Initializes the given mutex. |
| fpl_platform_api bool |
fplMutexLock (fplMutexHandle *mutex) Locks the given mutex and blocks any other threads. |
| fpl_platform_api bool |
fplMutexTryLock (fplMutexHandle *mutex) Tries to lock the given mutex without blocking other threads. |
| fpl_platform_api bool |
fplMutexUnlock (fplMutexHandle *mutex) Unlocks the given mutex. |
| fpl_platform_api bool |
fplOSGetVersionInfos (fplOSVersionInfos *outInfos) Gets version information from the operating system. |
| fpl_common_api size_t |
fplPathCombine (char *destPath, const size_t maxDestPathLen, const size_t pathCount,...) Combines all given paths by the platform's path separator for a fixed number of arguments. |
| fpl_platform_api size_t |
fplPathNormalize (const char *sourcePath, char *destPath, const size_t maxDestLen) Normalizes the specified source path into the dest path and len. |
| fpl_common_api const char * |
fplPlatformGetResultName (const fplPlatformResultType type) Gets the string representation of a platform result type. |
| fpl_common_api bool |
fplPlatformInit (const fplInitFlags initFlags, const fplSettings *initSettings) Initializes the platform layer. |
| fpl_common_api void |
fplPlatformRelease (void) Releases the resources allocated by the platform layer. |
| fpl_common_api fplAudioResultType |
fplPlayAudio (void) Start playing asynchronous audio. |
| fpl_platform_api bool |
fplPollEvent (fplEvent *ev) Polls the next event from the internal event queue or from the OS, handles them, and removes it from the queue. |
| fpl_platform_api void |
fplPollEvents (void) Polls all the events from the OS and clears the internal event queue. |
| fpl_platform_api bool |
fplPollGamepadStates (fplGamepadStates *outStates) Polls the current gamepad states and writes it out into the output structure. |
| fpl_platform_api bool |
fplPollKeyboardState (fplKeyboardState *outState) Polls the current keyboard state and writes it out into the output structure. |
| fpl_platform_api bool |
fplPollMouseState (fplMouseState *outState) Polls the current mouse state and writes it out into the output structure. |
| fpl_platform_api bool |
fplQueryCursorPosition (int32_t *outX, int32_t *outY) Queries the cursor position in screen coordinates, relative to the root screen. |
| fpl_common_api bool |
fplResizeVideoBackBuffer (const uint32_t width, const uint32_t height) Resizes the current video backbuffer. |
| fpl_common_api size_t |
fplS32ToString (const int32_t value, char *buffer, const size_t maxBufferLen) Converts the given 32-bit integer value into a string. |
| fpl_platform_api void |
fplSemaphoreDestroy (fplSemaphoreHandle *semaphore) Releases the internal semaphore resources. |
| fpl_platform_api bool |
fplSemaphoreInit (fplSemaphoreHandle *semaphore, const uint32_t initialValue) Initializes the semaphore with the given initial value. |
| fpl_platform_api bool |
fplSemaphoreRelease (fplSemaphoreHandle *semaphore) Increments the semaphore value by one. |
| fpl_platform_api bool |
fplSemaphoreTryWait (fplSemaphoreHandle *semaphore) Tries to wait for the semaphore until it gets signaled or returns immediately. |
| fpl_platform_api int32_t |
fplSemaphoreValue (fplSemaphoreHandle *semaphore) Gets the current semaphore value. |
| fpl_platform_api bool |
fplSemaphoreWait (fplSemaphoreHandle *semaphore, const fplTimeoutValue timeout) Waits for the semaphore until it gets signaled or the timeout has been reached. |
| fpl_platform_api size_t |
fplSessionGetUsername (char *nameBuffer, const size_t maxNameBufferLen) Gets the username of the current logged-in user from the session. |
| fpl_common_api bool |
fplSetAudioClientReadCallback (fpl_audio_client_read_callback *newCallback, void *userData) Overwrites the audio client read callback. |
| fpl_platform_api bool |
fplSetClipboardText (const char *text) Overwrites the current clipboard text with the given one. |
| 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. |
| fpl_common_api void |
fplSetLogSettings (const fplLogSettings *params) Overwrites the current log settings. |
| fpl_common_api void |
fplSetMaxLogLevel (const fplLogLevel maxLevel) Changes the current maximum log level to the given value. |
| fpl_platform_api bool |
fplSetThreadPriority (fplThreadHandle *thread, const fplThreadPriority newPriority) Changes the thread priority to the given one, for the given thread handle. |
| fpl_platform_api void |
fplSetWindowCursorEnabled (const bool value) Enables or disables the window cursor. |
| fpl_platform_api void |
fplSetWindowDecorated (const bool value) Enables or disables the window decoration (Titlebar, Border, etc.). |
| fpl_platform_api void |
fplSetWindowFloating (const bool value) Enables or disables the window floating (Top-most). |
| fpl_platform_api bool |
fplSetWindowFullscreenRect (const bool value, const int32_t x, const int32_t y, const int32_t width, const int32_t height) Enables or disables fullscreen mode based on the given rectangle. |
| fpl_platform_api bool |
fplSetWindowFullscreenSize (const bool value, const uint32_t fullscreenWidth, const uint32_t fullscreenHeight, const uint32_t refreshRate) Enables or disables fullscreen mode based on the given size and the current display. |
| fpl_common_api void |
fplSetWindowInputEvents (const bool enabled) Enables or disables the input events for the window entirely. |
| fpl_platform_api void |
fplSetWindowPosition (const int32_t left, const int32_t top) Changes the window absolute position to the given coordinates. |
| fpl_platform_api void |
fplSetWindowResizeable (const bool value) Enables or disables the ability to resize the window. |
| fpl_platform_api void |
fplSetWindowSize (const uint32_t width, const uint32_t height) Resizes the window to fit the inner size based on the given size. |
| fpl_platform_api bool |
fplSetWindowState (const fplWindowState newState) Changes the current window state. |
| fpl_platform_api void |
fplSetWindowTitle (const char *title) Changes the window title to the given string. |
| fpl_platform_api void |
fplSignalDestroy (fplSignalHandle *signal) Releases the given signal and clears the structure to zero. |
| fpl_platform_api bool |
fplSignalInit (fplSignalHandle *signal, const fplSignalValue initialValue) Initializes the given signal. |
| fpl_platform_api bool |
fplSignalReset (fplSignalHandle *signal) Resets the signal. |
| fpl_platform_api bool |
fplSignalSet (fplSignalHandle *signal) Sets the signal and wakes up the given signal. |
| fpl_platform_api bool |
fplSignalWaitForAll (fplSignalHandle **signals, const size_t count, const size_t stride, const fplTimeoutValue timeout) Waits until all the given signals are woken up. |
| fpl_platform_api bool |
fplSignalWaitForAny (fplSignalHandle **signals, const size_t count, const size_t stride, const fplTimeoutValue timeout) Waits until any of the given signals wakes up or the timeout has been reached. |
| fpl_platform_api bool |
fplSignalWaitForOne (fplSignalHandle *signal, const fplTimeoutValue timeout) Waits until the given signal is woken up. |
| fpl_common_api fplAudioResultType |
fplStopAudio (void) Stop playing asynchronous audio. |
| fpl_common_api size_t |
fplStringAppend (const char *appended, char *buffer, size_t maxBufferLen) Appends the source string to the given buffer. |
| fpl_common_api size_t |
fplStringAppendLen (const char *appended, const size_t appendedLen, char *buffer, size_t maxBufferLen) Appends the source string to the given buffer constrained by length. |
| fpl_common_api size_t |
fplStringFormat (char *destBuffer, const size_t maxDestBufferLen, const char *format,...) Fills out the given destination string buffer with a formatted string, using the format specifier and variable arguments. |
| fpl_common_api size_t |
fplStringFormatArgs (char *destBuffer, const size_t maxDestBufferLen, const char *format, va_list argList) Fills out the given destination string buffer with a formatted string, using the format specifier and the arguments list. |
| fpl_common_api int32_t |
fplStringToS32 (const char *str) Converts the given string into a 32-bit integer. |
| fpl_common_api int32_t |
fplStringToS32Len (const char *str, const size_t len) Converts the given string into a 32-bit integer constrained by string length. |
| fpl_platform_api fplThreadHandle * |
fplThreadCreate (fpl_run_thread_callback *runFunc, void *data) Creates and starts a thread and returns the handle to it. |
| fpl_platform_api fplThreadHandle * |
fplThreadCreateWithParameters (fplThreadParameters *parameters) Creates and starts a thread from the specified parameters and returns the handle to it. |
| fpl_platform_api void |
fplThreadSleep (const uint32_t milliseconds) Lets the current thread sleep for the given amount of milliseconds. |
| fpl_platform_api bool |
fplThreadTerminate (fplThreadHandle *thread) Forces the given thread to stop and release all underlying resources. |
| fpl_platform_api bool |
fplThreadWaitForAll (fplThreadHandle **threads, const size_t count, const size_t stride, const fplTimeoutValue timeout) Waits until all given threads are done running or the given timeout has been reached. |
| fpl_platform_api bool |
fplThreadWaitForAny (fplThreadHandle **threads, const size_t count, const size_t stride, const fplTimeoutValue timeout) Waits until one of the given threads is done running or the given timeout has been reached. |
| fpl_platform_api bool |
fplThreadWaitForOne (fplThreadHandle *thread, const fplTimeoutValue timeout) Waits until the given thread is done running or the given timeout has been reached. |
| fpl_platform_api bool |
fplThreadYield (void) Lets the current thread yield execution to another thread that is ready to run on this core. |
| fpl_platform_api fplSeconds |
fplTimestampElapsed (const fplTimestamp start, const fplTimestamp finish) Gets the delta value from two fplTimestamp values in seconds. |
| fpl_platform_api fplTimestamp |
fplTimestampQuery (void) Gets the current fplTimestamp with most precision, used for time delta measurements only. |
| fpl_common_api bool |
fplTryStringToS32 (const char *str, int32_t *outValue) Try to convert the given NUL-terminated string into a 32-bit integer. |
| fpl_common_api bool |
fplTryStringToS32Len (const char *str, const size_t len, int32_t *outValue) Try to convert the given string into a 32-bit integer constrained by string length. |
| fpl_common_api bool |
fplUpdateInputDevices (void) Refreshes the input subsystem's device list and processes pending hotplug events. |
| fpl_platform_api size_t |
fplUTF8StringToWideString (const char *utf8Source, const size_t utf8SourceLen, wchar_t *wideDest, const size_t maxWideDestLen) Converts the given 8-bit UTF-8 source ANSI string with length into a 16-bit wide string. |
| fpl_common_api void |
fplVideoFlip (void) Forces the window to be redrawn or to swap the back/front buffer. |
| fpl_platform_api size_t |
fplWideStringToUTF8String (const wchar_t *wideSource, const size_t wideSourceLen, char *utf8Dest, const size_t maxUtf8DestLen) Converts the given 16-bit source wide string with length into an 8-bit UTF-8 ANSI string. |
| fpl_platform_api void |
fplWindowShutdown (void) Closes the window and stops the event loop. |
| fpl_platform_api bool |
fplWindowUpdate (void) Clears the internal event queue and updates input devices if needed. |
Final Platform Layer (FPL) - A C99 Single-Header-File Platform Abstraction Library.
Version: v1.0.0
Author: Torsten Spaete
Definition in file final_platform_layer.h.
#define FPL_APPTYPE_WINDOWApplication is built as a windowed application (a window is created by FPL).
Definition at line 2692 of file final_platform_layer.h.
#define FPL_CACHELINE_SIZECacheline size for Default Architecture (64-bytes).
Definition at line 2219 of file final_platform_layer.h.
#define FPL_CPU_32BIT32-bit CPU detected.
Definition at line 2181 of file final_platform_layer.h.
#define FPL_ENUM_AS_FLAGS_OPERATORS ( type)Defines bitwise operator overloads for the given enum type (C++ only, no-op in C).
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | type | The type of the enum. |
Definition at line 3591 of file final_platform_layer.h.
#define FPL_FUNCTION_NAMEFunction name macro.
Definition at line 2771 of file final_platform_layer.h.
#define FPL_IS_IDEIs set when an IDE is active, like IntelliSense or JetBrains.
Returns: A boolean indicating whether an IDE is active or not.
Definition at line 2765 of file final_platform_layer.h.
#define fpl_nullDefines a NULL pointer value that works in C/C++.
Definition at line 3249 of file final_platform_layer.h.
#define FPL_X86_CPU_INSTR_SET_LEVELCompiled X86 CPU Instruction Set.
Definition at line 2838 of file final_platform_layer.h.
#define fplAlignAs ( N)Structure alignment in bytes.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | N | Alignment size. Must be a power-of-two integer literal. |
Definition at line 2464 of file final_platform_layer.h.
#define fplAsmAn assembler keyword (asm) that is compiler-specific.
Definition at line 2422 of file final_platform_layer.h.
#define fplHasInclude ( inc)Test for include existence.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | inc | Path to the include file. |
Returns: A boolean indicating whether the specified include has been found or not.
Definition at line 2320 of file final_platform_layer.h.
#define fplMinAlignmentMinimum structure alignment in bytes.
Returns: The minimum alignment in bytes.
Definition at line 2444 of file final_platform_layer.h.
typedef int32_t fpl_b32Defines an integer-based boolean that has a width of 32-bit.
Note: Reserved for ABI-stable boolean fields inside public structs. Use C99
bool for return values and parameters.
Definition at line 3256 of file final_platform_layer.h.
enum fplX86InstructionSetLevelDefines the X86 instruction sets up to AVX512.
Definition at line 2785 of file final_platform_layer.h.
- 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