|
Final Platform Layer 0.9.9-beta
|
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>Go to the source code of this file.
Data Structures | |
| 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 | fplAudioDeviceInfoExtended |
| Stores the fplAudioDeviceInfo and the supported formats. 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 | 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... | |
| struct | fplEvent |
| A structure containing event data for all event types (Window, Keyboard, Mouse, etc.). More... | |
| struct | fplFileEntry |
| A structure containing the informations for a file or directory (name, type, attributes, etc.). More... | |
| struct | fplFileHandle |
| The filehandle structure. More... | |
| union | fplFilePermissions |
| A union containing the file permissions (UMask). More... | |
| struct | fplFileTimeStamps |
| A structure containing filestamps for creation/access/modify date. More... | |
| struct | fplGamepadButton |
| A structure containing properties for a gamepad button (IsDown, etc.). More... | |
| struct | fplGamepadEvent |
| A structure containing gamepad event data (Type, Device, State, etc.). More... | |
| struct | fplGamepadState |
| A structure containing the entire gamepad state. 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 | 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 |
| A union containing the internal filehandle for any platform. More... | |
| union | fplInternalFileHandle |
| A union containing the internal filehandle for any platform. More... | |
| struct | fplInternalFileRootInfo |
| A structure containing the internal root file informations. 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 |
| Stores console logging properties. 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 informations. 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... | |
Macros | |
| #define | fpl_api |
| API call. | |
| #define | FPL_APPTYPE_WINDOW |
| Detected window application type. | |
| #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) |
| Internal macro used to create required enum operators for C++. | |
| #define | fpl_extern |
| External call. | |
| #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_globalvar |
| Global persistent variable. | |
| #define | fpl_inline |
| Inline function. | |
| #define | fpl_internal |
| Private/Internal function. | |
| #define | fpl_internal_inline |
| Internal inlined function. | |
| #define | FPL_IS_IDE |
| Is set when a IDE is active, like Intellisense or jetbrains. | |
| #define | fpl_localvar |
| Local persistent variable. | |
| #define | fpl_main |
| Main entry point API definition. | |
| #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_KEYBOARD_STATE_COUNT |
| Max number of keyboard states. | |
| #define | FPL_MAX_NAME_LENGTH |
| Maximum length of a name (in characters). | |
| #define | FPL_MAX_PATH_LENGTH |
| Maximum length of a path. | |
| #define | fpl_no_inline |
| Prevents inlining of this function. | |
| #define | FPL_NOT_IMPLEMENTED |
| This will full-on crash when something is not implemented always. | |
| #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 |
| A assembler compiler instruction (asm). | |
| #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 endianess that is built from the values (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 | 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. | |
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 int32_t | fpl_b32 |
| Defines a integer based boolean that has a width of 32-bit. | |
| 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 struct fplARMCPUCapabilities | fplARMCPUCapabilities |
| typedef enum fplAudioBackendType | fplAudioBackendType |
| typedef enum fplAudioChannelLayout | fplAudioChannelLayout |
| typedef struct fplAudioChannelMap | fplAudioChannelMap |
| typedef enum fplAudioChannelType | fplAudioChannelType |
| typedef enum fplAudioDefaultFields | fplAudioDefaultFields |
| typedef union fplAudioDeviceID | fplAudioDeviceID |
| typedef struct fplAudioDeviceInfo | fplAudioDeviceInfo |
| typedef struct fplAudioDeviceInfoExtended | fplAudioDeviceInfoExtended |
| typedef struct fplAudioFormat | fplAudioFormat |
| typedef enum fplAudioFormatType | fplAudioFormatType |
| 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 enum fplAudioLatencyType | fplAudioLatencyType |
| typedef enum fplAudioMode | fplAudioMode |
| typedef enum fplAudioResultType | fplAudioResultType |
| typedef struct fplAudioSettings | fplAudioSettings |
| typedef enum fplAudioShareMode | fplAudioShareMode |
| typedef enum fplButtonState | fplButtonState |
| typedef union fplColor32 | fplColor32 |
| typedef struct fplConditionVariable | fplConditionVariable |
| typedef struct fplConsoleSettings | fplConsoleSettings |
| typedef enum fplCPUArchType | fplCPUArchType |
| typedef struct fplCPUCapabilities | fplCPUCapabilities |
| typedef enum fplCPUCapabilitiesType | fplCPUCapabilitiesType |
| typedef union fplCPUIDLeaf | fplCPUIDLeaf |
| typedef struct fplDisplayInfo | fplDisplayInfo |
| typedef struct fplDisplayMode | fplDisplayMode |
| typedef struct fplDynamicLibraryHandle | fplDynamicLibraryHandle |
| typedef struct fplEvent | fplEvent |
| typedef enum fplEventType | fplEventType |
| typedef enum fplFileAttributeFlags | fplFileAttributeFlags |
| typedef struct fplFileEntry | fplFileEntry |
| typedef enum fplFileEntryType | fplFileEntryType |
| typedef struct fplFileHandle | fplFileHandle |
| typedef enum fplFilePermissionFlags | fplFilePermissionFlags |
| typedef enum fplFilePermissionMasks | fplFilePermissionMasks |
| typedef union fplFilePermissions | fplFilePermissions |
| typedef enum fplFilePositionMode | fplFilePositionMode |
| typedef uint64_t | fplFileTimeStamp |
| The elapsed seconds since the UNIX epoch (1970-01-01 00:00:00). | |
| typedef struct fplFileTimeStamps | fplFileTimeStamps |
| typedef struct fplGamepadButton | fplGamepadButton |
| typedef enum fplGamepadButtonType | fplGamepadButtonType |
| typedef struct fplGamepadEvent | fplGamepadEvent |
| typedef enum fplGamepadEventType | fplGamepadEventType |
| typedef struct fplGamepadState | fplGamepadState |
| typedef struct fplGamepadStates | fplGamepadStates |
| typedef struct fplGraphicsApiSettings | fplGraphicsApiSettings |
| typedef struct fplImageSource | fplImageSource |
| typedef enum fplImageType | fplImageType |
| typedef enum fplInitFlags | fplInitFlags |
| typedef struct fplInputSettings | fplInputSettings |
| typedef union fplInternalConditionVariable | fplInternalConditionVariable |
| typedef union fplInternalDynamicLibraryHandle | fplInternalDynamicLibraryHandle |
| typedef union fplInternalFileEntryHandle | fplInternalFileEntryHandle |
| typedef union fplInternalFileHandle | fplInternalFileHandle |
| typedef struct fplInternalFileRootInfo | fplInternalFileRootInfo |
| typedef union fplInternalMutexHandle | fplInternalMutexHandle |
| typedef union fplInternalSemaphoreHandle | fplInternalSemaphoreHandle |
| typedef union fplInternalSignalHandle | fplInternalSignalHandle |
| typedef union fplInternalThreadHandle | fplInternalThreadHandle |
| typedef enum fplKey | fplKey |
| typedef struct fplKeyboardEvent | fplKeyboardEvent |
| typedef enum fplKeyboardEventType | fplKeyboardEventType |
| typedef enum fplKeyboardModifierFlags | fplKeyboardModifierFlags |
| typedef struct fplKeyboardState | fplKeyboardState |
| typedef enum fplLocaleFormat | fplLocaleFormat |
| typedef enum fplLogLevel | fplLogLevel |
| typedef struct fplLogSettings | fplLogSettings |
| typedef struct fplLogWriter | fplLogWriter |
| typedef struct fplLogWriterConsole | fplLogWriterConsole |
| typedef struct fplLogWriterCustom | fplLogWriterCustom |
| typedef enum fplLogWriterFlags | fplLogWriterFlags |
| typedef enum fplMemoryAllocationMode | fplMemoryAllocationMode |
| typedef struct fplMemoryAllocationSettings | fplMemoryAllocationSettings |
| typedef struct fplMemoryBlock | fplMemoryBlock |
| typedef struct fplMemoryInfos | fplMemoryInfos |
| typedef struct fplMemorySettings | fplMemorySettings |
| typedef uint64_t | fplMilliseconds |
| A type definition for milliseconds (64-bit). | |
| typedef enum fplMouseButtonType | fplMouseButtonType |
| typedef struct fplMouseEvent | fplMouseEvent |
| typedef enum fplMouseEventType | fplMouseEventType |
| typedef struct fplMouseState | fplMouseState |
| typedef struct fplMutexHandle | fplMutexHandle |
| typedef enum fplOpenGLCompabilityFlags | fplOpenGLCompabilityFlags |
| typedef struct fplOpenGLSettings | fplOpenGLSettings |
| typedef struct fplOSVersionInfos | fplOSVersionInfos |
| typedef enum fplPlatformResultType | fplPlatformResultType |
| typedef enum fplPlatformType | fplPlatformType |
| typedef double | fplSeconds |
| A type definition for seconds (64-bit). | |
| typedef struct fplSemaphoreHandle | fplSemaphoreHandle |
| typedef struct fplSettings | fplSettings |
| typedef struct fplSignalHandle | fplSignalHandle |
| typedef enum fplSignalValue | fplSignalValue |
| typedef union fplSpecificAudioSettings | fplSpecificAudioSettings |
| typedef struct fplThreadHandle | fplThreadHandle |
| Forward declared thread handle. | |
| typedef struct fplThreadParameters | fplThreadParameters |
| typedef enum fplThreadPriority | fplThreadPriority |
| typedef uint32_t | fplThreadState |
| A type definition for mapping fplThreadState into a 32-bit integer. | |
| typedef enum fplThreadStates | fplThreadStates |
| typedef uint32_t | fplTimeoutValue |
| A type definition for a timeout value in milliseconds. | |
| typedef union fplTimestamp | fplTimestamp |
| typedef struct fplVersionInfo | fplVersionInfo |
| typedef char | fplVersionNumberPart[4+1] |
| A type definition for mapping a part of a version number. | |
| typedef struct fplVideoBackBuffer | fplVideoBackBuffer |
| typedef enum fplVideoBackendType | fplVideoBackendType |
| typedef struct fplVideoRect | fplVideoRect |
| typedef union fplVideoRequirements | fplVideoRequirements |
| typedef struct fplVideoRequirementsVulkan | fplVideoRequirementsVulkan |
| typedef struct fplVideoSettings | fplVideoSettings |
| typedef struct fplVideoSurface | fplVideoSurface |
| typedef struct fplVideoSurfaceOpenGL | fplVideoSurfaceOpenGL |
| typedef struct fplVideoSurfaceVulkan | fplVideoSurfaceVulkan |
| typedef union fplVideoWindow | fplVideoWindow |
| typedef struct fplVulkanSettings | fplVulkanSettings |
| 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. | |
| typedef enum fplVulkanValidationLayerMode | fplVulkanValidationLayerMode |
| typedef enum fplVulkanValidationSeverity | fplVulkanValidationSeverity |
| typedef struct fplWindowCallbacks | fplWindowCallbacks |
| typedef struct fplWindowDropFiles | fplWindowDropFiles |
| typedef struct fplWindowEvent | fplWindowEvent |
| typedef enum fplWindowEventType | fplWindowEventType |
| typedef struct fplWindowPosition | fplWindowPosition |
| typedef struct fplWindowSettings | fplWindowSettings |
| typedef struct fplWindowSize | fplWindowSize |
| typedef enum fplWindowState | fplWindowState |
| typedef enum fplWindowVisibilityState | fplWindowVisibilityState |
| typedef struct fplX86CPUCapabilities | fplX86CPUCapabilities |
| typedef enum fplX86InstructionSetLevel | fplX86InstructionSetLevel |
Functions | |
| FPL_ENUM_AS_FLAGS_OPERATORS (fplAudioChannelType) | |
| Audio speaker layout operator overloads for C++. | |
| FPL_ENUM_AS_FLAGS_OPERATORS (fplAudioDefaultFields) | |
| fplAudioDefaultFields operator overloads for C++. | |
| FPL_ENUM_AS_FLAGS_OPERATORS (fplFileAttributeFlags) | |
| FileAttributeFlags operator overloads for C++. | |
| FPL_ENUM_AS_FLAGS_OPERATORS (fplFilePermissionFlags) | |
| fplFilePermissionFlags operator overloads for C++. | |
| FPL_ENUM_AS_FLAGS_OPERATORS (fplFilePermissionMasks) | |
| fplFilePermissionMasks operator overloads for C++. | |
| FPL_ENUM_AS_FLAGS_OPERATORS (fplInitFlags) | |
| InitFlags operator overloads for C++. | |
| FPL_ENUM_AS_FLAGS_OPERATORS (fplKeyboardModifierFlags) | |
| fplKeyboardModifierFlags operator overloads for C++. | |
| FPL_ENUM_AS_FLAGS_OPERATORS (fplLogWriterFlags) | |
| Log writer flags enumeration operators. | |
| 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 char * | fplCopyString (const char *source, char *dest, const size_t maxDestLen) |
| Copies the given source string into a destination string. | |
| fpl_common_api char * | 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 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 char * | fplEnforcePathSeparator (char *path) |
| Ensures that the given string always ends with a path separator. | |
| fpl_common_api char * | 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 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_common_api size_t | fplFileWriteBlock (const fplFileHandle *fileHandle, 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, 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, void *sourceBuffer, const uint64_t sourceSize) |
| Writes a block to the given file and returns the number of written bytes. | |
| 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) |
| Gets the name of the specified audio channel type. | |
| fpl_common_api bool | fplGetAudioDeviceInfo (const fplAudioDeviceID *deviceId, fplAudioDeviceInfoExtended *outDeviceInfo) |
| Gets the full audio device info extended 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 uint32_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_platform_api size_t | fplGetHomePath (char *destPath, const size_t maxDestLen) |
| Gets the full path to your home directory. | |
| 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 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 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 char * | fplGetWindowTitle (char *outTitle, const size_t maxOutTitleLength) |
| Retrieves the window title and writes it into the output string. | |
| 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 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 | fplMemoryGetInfos (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_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 | 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. | |
| fplStaticAssert (sizeof(fplARMCPUCapabilities)<=28) | |
| fplStaticAssert (sizeof(fplCPUCapabilities)==32) | |
| fplStaticAssert (sizeof(fplCPUIDLeaf)==16) | |
| fplStaticAssert (sizeof(fplX86CPUCapabilities)<=28) | |
| fpl_common_api fplAudioResultType | fplStopAudio (void) |
| Stop playing asynchronous audio. | |
| fpl_common_api char * | fplStringAppend (const char *appended, char *buffer, size_t maxBufferLen) |
| Appends the source string to the given buffer. | |
| fpl_common_api char * | 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_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.
Definition in file final_platform_layer.h.
| #define FPL_APPTYPE_WINDOW |
Detected window application type.
Definition at line 2247 of file final_platform_layer.h.
| #define FPL_CPU_32BIT |
32-bit CPU detected.
Definition at line 1852 of file final_platform_layer.h.
| #define FPL_ENUM_AS_FLAGS_OPERATORS | ( | type | ) |
Internal macro used to create required enum operators for C++.
| [in] | type | The type of the enum. |
Definition at line 3013 of file final_platform_layer.h.
| #define FPL_FUNCTION_NAME |
Function name macro.
Definition at line 2323 of file final_platform_layer.h.
| #define FPL_IS_IDE |
Is set when a IDE is active, like Intellisense or jetbrains.
Definition at line 2317 of file final_platform_layer.h.
| #define fpl_null |
Defines a NULL pointer value that works in C/C++.
Definition at line 2693 of file final_platform_layer.h.
| #define FPL_X86_CPU_INSTR_SET_LEVEL |
Compiled X86 CPU Instruction Set.
Definition at line 2390 of file final_platform_layer.h.
| #define fplAlignAs | ( | N | ) |
Structure alignment in bytes.
| [in] | N | Alignment size. |
Definition at line 2038 of file final_platform_layer.h.
| #define fplAsm |
A assembler compiler instruction (asm).
Definition at line 1995 of file final_platform_layer.h.
| #define fplHasInclude | ( | inc | ) |
Test for include existence.
| inc | Path to the include file. |
Definition at line 2425 of file final_platform_layer.h.
| #define fplMinAlignment |
Minimum structure alignment in bytes.
Definition at line 2017 of file final_platform_layer.h.
| typedef int32_t fpl_b32 |
Defines a integer based boolean that has a width of 32-bit.
Definition at line 2699 of file final_platform_layer.h.
Defines the X86 instruction sets up to AVX512.
Definition at line 2337 of file final_platform_layer.h.