-
Notifications
You must be signed in to change notification settings - Fork 13
Function macros
This category contains several useful macro functions. More...
| Type | Name |
|---|---|
| union |
fplEndianess Byte-order probe union that overlays a 32-bit integer with its raw bytes. More... |
| Type | Name |
|---|---|
| #define |
FPL_NOT_IMPLEMENTED Crashes the application via a null-pointer write. |
| #define |
fplArrayCount(arr) Returns the element count from a static array. |
| #define |
fplClearStruct(ptr) Clears the given struct pointer to zero. |
| #define |
fplCopyStruct(src, dst) Copies the given source struct into the destination struct. |
| #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 |
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 |
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 |
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 |
|---|---|
| enum |
fplEndianessType { fplEndianessType_Little , fplEndianessType_Big } Sentinel values used to detect the byte order of the host platform at runtime. More... |
This category contains several useful macro functions.
#define FPL_NOT_IMPLEMENTEDCrashes the application via a null-pointer write.
Marks code paths that are not implemented.
Definition at line 3293 of file final_platform_layer.h.
#define fplArrayCount ( arr)Returns the element count from a static array.
This should ideally produce a compile error when passing a pointer to it.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | arr | Array to count elements. |
Returns: Element count.
Definition at line 3513 of file final_platform_layer.h.
#define fplClearStruct ( ptr)Clears the given struct pointer to zero.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | ptr | Pointer to the struct. |
Definition at line 3486 of file final_platform_layer.h.
#define fplCopyStruct ( src, dst )Copies the given source struct into the destination struct.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | src | Source struct pointer. |
| [out] | dst | Destination struct pointer. |
Definition at line 3494 of file final_platform_layer.h.
#define fplGetAlignedSize ( size, alignment )Returns the given size, extended to satisfy the given alignment boundary.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | size | Size to align. |
| [in] | alignment | Alignment boundary. |
Returns: Aligned size.
Definition at line 3358 of file final_platform_layer.h.
#define fplGetAlignmentOffset ( value, alignment )Returns the offset for the value to satisfy the given alignment boundary.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | value | Value to align. |
| [in] | alignment | Alignment boundary. |
Returns: Offset to satisfy the alignment boundary.
Definition at line 3349 of file final_platform_layer.h.
#define fplGetEndianess32 ( )Returns the unsigned 32-bit integer value that represents the current platform endianness, built from the byte sequence (0, 1, 2, 3).
Returns: Unsigned 32-bit integer endianness probe value.
Definition at line 3479 of file final_platform_layer.h.
#define fplGigaBytes ( value)Returns the number of bytes for the given gigabytes.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | value | Value in gigabytes. |
Returns: Number of bytes.
Definition at line 3408 of file final_platform_layer.h.
#define fplIsAligned ( ptr, alignment )Returns true when the given pointer address is aligned to the given alignment.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | ptr | Pointer to check. |
| [in] | alignment | Alignment boundary. |
Returns: True if the pointer is aligned, false otherwise.
Definition at line 3367 of file final_platform_layer.h.
#define fplIsBigEndian ( )Gets a value indicating whether the current platform is big-endian or not.
Returns: Returns true if the platform is big-endian, false otherwise.
Definition at line 3465 of file final_platform_layer.h.
#define fplIsBitSet ( value, bit )Returns true when the given value has the given bit set.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | value | Value to check. |
| [in] | bit | Bit position to check. |
Returns: True if the bit is set, false otherwise.
Definition at line 3384 of file final_platform_layer.h.
#define fplIsLittleEndian ( )Gets a value indicating whether the current platform is little-endian or not.
Returns: Returns true if the platform is little-endian, false otherwise.
Definition at line 3472 of file final_platform_layer.h.
#define fplIsMaskSet ( value, mask )Returns true when the given mask is set in the value.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | value | Value to check. |
| [in] | mask | Bit mask to check. |
Returns: True if the mask is set, false otherwise.
Definition at line 3425 of file final_platform_layer.h.
#define fplIsPowerOfTwo ( value)Returns true when the given value is a power of two.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | value | Value to check. |
Returns: True if the value is a power of two, false otherwise.
Definition at line 3375 of file final_platform_layer.h.
#define fplKiloBytes ( value)Returns the number of bytes for the given kilobytes.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | value | Value in kilobytes. |
Returns: Number of bytes.
Definition at line 3392 of file final_platform_layer.h.
#define fplMax ( a, b )Returns the biggest value of A and B.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | a | First value. |
| [in] | b | Second value. |
Returns: Biggest value.
Definition at line 3540 of file final_platform_layer.h.
#define fplMegaBytes ( value)Returns the number of bytes for the given megabytes.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | value | Value in megabytes. |
Returns: Number of bytes.
Definition at line 3400 of file final_platform_layer.h.
#define fplMin ( a, b )Returns the smallest value of A and B.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | a | First value. |
| [in] | b | Second value. |
Returns: Smallest value.
Definition at line 3531 of file final_platform_layer.h.
#define fplOffsetOf ( type, field )Returns the offset in bytes for the specified structure type and field name.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | type | Structure type. |
| [in] | field | Field name. |
Returns: Offset in bytes.
Definition at line 3522 of file final_platform_layer.h.
#define fplStackAllocate ( size)Manually allocate the number of specified bytes of memory on the stack.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | size | Number of bytes to allocate. |
Returns: A pointer to the start of the stack memory.
Note: Use this very carefully, as it may break stack memory!
Definition at line 3555 of file final_platform_layer.h.
#define fplStructFieldDefines a single field in a struct.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | type | The identifier of the struct. |
| [in] | name | The name of the field. |
| [in] | ... | Value of the field from variable arguments. |
Returns: The constructed field.
Definition at line 3340 of file final_platform_layer.h.
#define fplStructInitInitializes a struct by the given type.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | type | The identifier of the struct. |
| [in] | ... | Value of the struct from variable arguments without braces in between. |
Returns: The initialized struct command.
Definition at line 3330 of file final_platform_layer.h.
#define fplStructSetOverwrites the value of the given struct to a new value.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in/out] | ptr The reference to the output struct. | |
| [in] | type | The identifier of the struct. |
| [in] | value | The new value that is written to the struct reference. |
Definition at line 3321 of file final_platform_layer.h.
#define fplTeraBytes ( value)Returns the number of bytes for the given terabytes.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | value | Value in terabytes. |
Returns: Number of bytes.
Definition at line 3416 of file final_platform_layer.h.
#define fplZeroInitInitializes a struct to zero.
Returns: The command that initializes a struct to zero, e.g. {0} or {}.
Definition at line 3312 of file final_platform_layer.h.
enum fplEndianessTypeSentinel values used to detect the byte order of the host platform at runtime.
| Name | Description |
|---|---|
| fplEndianessType_Little | Little-endian type. |
| fplEndianessType_Big | Big-endian type. |
Definition at line 3435 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