Final Platform Layer 0.9.8-beta
Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations | Functions
Settings & Configurations

This category contains global settings structures/enumerations and functions to initialize/set them. More...

Data Structures

struct  fplAudioDeviceFormat
 A structure containing audio device format runtime properties, such as type, samplerate, channels, etc. More...
 
union  fplAudioDeviceID
 A union containing a id of the underlying backend. More...
 
struct  fplAudioDeviceInfo
 A structure containing the name and the id of the audio device. More...
 
struct  fplAudioSettings
 A structure containing audio settings, such as format, device info, callbacks, backend, etc. More...
 
struct  fplAudioTargetFormat
 A structure containing audio target format configurations, such as type, sample rate, channels, etc. More...
 
union  fplColor32
 Defines a 32-bit color in format BGRA. More...
 
struct  fplConsoleSettings
 A structure containing the title and options for the console. More...
 
struct  fplGraphicsApiSettings
 A union that contains graphics api settings. More...
 
struct  fplImageSource
 A structure containing data for working with a image source. More...
 
struct  fplInputSettings
 A structure containing input settings. More...
 
struct  fplMemoryAllocationSettings
 A structure for setting up memory allocation usage. More...
 
struct  fplMemorySettings
 A structure for setting up memory settings for dynamic and temporary allocations. More...
 
struct  fplOpenGLSettings
 A structure that contains OpenGL video settings. More...
 
struct  fplSettings
 A structure containing settings, such as window, video, etc. More...
 
union  fplSpecificAudioSettings
 A union containing backend specific audio settings. More...
 
struct  fplVideoSettings
 A structure that contains video settings such as backend, v-sync, API-settings, etc. More...
 
struct  fplVulkanSettings
 A structure that contains Vulkan video settings. More...
 
struct  fplWindowCallbacks
 A structure containing the window callbacks. More...
 
struct  fplWindowPosition
 A structure containing the position of a window. More...
 
struct  fplWindowSettings
 A structure containing window settings, such as size, title etc. More...
 
struct  fplWindowSize
 A structure containing the size of a window. More...
 

Typedefs

typedef uint32_t() fpl_audio_client_read_callback(const fplAudioDeviceFormat *deviceFormat, const uint32_t frameCount, void *outputSamples, void *userData)
 A callback for reading audio samples from the client.
 
typedef void *() fpl_memory_allocate_callback(void *userData, const size_t size, const size_t alignment)
 Custom memory allocation callback.
 
typedef void() fpl_memory_release_callback(void *userData, void *ptr)
 Custom memory release callback.
 
typedef bool() fpl_window_event_callback(const fplPlatformType platformType, void *windowState, void *rawEventData, void *userData)
 A callback executed for each raw window event.
 
typedef fpl_window_event_callback fpl_window_exposed_callback
 A callback executed when the window needs to be exposed/repainted.
 
typedef enum fplAudioBackendType fplAudioBackendType
 An enumeration of audio backend types.
 
typedef enum fplAudioDefaultFields fplAudioDefaultFields
 An enumeration of audio default fields.
 
typedef struct fplAudioDeviceFormat fplAudioDeviceFormat
 A structure containing audio device format runtime properties, such as type, samplerate, channels, etc.
 
typedef union fplAudioDeviceID fplAudioDeviceID
 A union containing a id of the underlying backend.
 
typedef struct fplAudioDeviceInfo fplAudioDeviceInfo
 A structure containing the name and the id of the audio device.
 
typedef enum fplAudioFormatType fplAudioFormatType
 An enumeration of audio format types.
 
typedef enum fplAudioLatencyMode fplAudioLatencyMode
 An enumeration of audio latency modes.
 
typedef struct fplAudioSettings fplAudioSettings
 A structure containing audio settings, such as format, device info, callbacks, backend, etc.
 
typedef struct fplAudioTargetFormat fplAudioTargetFormat
 A structure containing audio target format configurations, such as type, sample rate, channels, etc.
 
typedef union fplColor32 fplColor32
 Defines a 32-bit color in format BGRA.
 
typedef struct fplConsoleSettings fplConsoleSettings
 A structure containing the title and options for the console.
 
typedef struct fplGraphicsApiSettings fplGraphicsApiSettings
 A union that contains graphics api settings.
 
typedef struct fplImageSource fplImageSource
 A structure containing data for working with a image source.
 
typedef enum fplImageType fplImageType
 An enumeration of image types.
 
typedef enum fplInitFlags fplInitFlags
 An enumeration of initialization flags.
 
typedef struct fplInputSettings fplInputSettings
 A structure containing input settings.
 
typedef enum fplMemoryAllocationMode fplMemoryAllocationMode
 A enumeration of dynamic memory allocation modes.
 
typedef struct fplMemoryAllocationSettings fplMemoryAllocationSettings
 A structure for setting up memory allocation usage.
 
typedef struct fplMemorySettings fplMemorySettings
 A structure for setting up memory settings for dynamic and temporary allocations.
 
typedef enum fplOpenGLCompabilityFlags fplOpenGLCompabilityFlags
 An enumeration of OpenGL compability flags.
 
typedef struct fplOpenGLSettings fplOpenGLSettings
 A structure that contains OpenGL video settings.
 
typedef enum fplPlatformResultType fplPlatformResultType
 An enumeration of platform result types.
 
typedef enum fplPlatformType fplPlatformType
 An enumeration of platform types.
 
typedef struct fplSettings fplSettings
 A structure containing settings, such as window, video, etc.
 
typedef union fplSpecificAudioSettings fplSpecificAudioSettings
 A union containing backend specific audio settings.
 
typedef enum fplVideoBackendType fplVideoBackendType
 An enumeration of video backend types.
 
typedef struct fplVideoSettings fplVideoSettings
 A structure that contains video settings such as backend, v-sync, API-settings, etc.
 
typedef struct fplVulkanSettings fplVulkanSettings
 A structure that contains Vulkan video settings.
 
typedef void() fplVulkanValidationLayerCallback(void *userData, const char *message, const uint32_t messageSeverity, const uint32_t messageType, const void *debugUtilsMessengerCallbackData)
 The debug callback called when the validation layer writes something.
 
typedef enum fplVulkanValidationLayerMode fplVulkanValidationLayerMode
 The validation layer modes for Vulkan.
 
typedef enum fplVulkanValidationSeverity fplVulkanValidationSeverity
 The validation layer logging severity for Vulkan.
 
typedef struct fplWindowCallbacks fplWindowCallbacks
 A structure containing the window callbacks.
 
typedef struct fplWindowPosition fplWindowPosition
 A structure containing the position of a window.
 
typedef struct fplWindowSettings fplWindowSettings
 A structure containing window settings, such as size, title etc.
 
typedef struct fplWindowSize fplWindowSize
 A structure containing the size of a window.
 

Enumerations

enum  fplAudioBackendType {
  fplAudioBackendType_None , fplAudioBackendType_Auto , fplAudioBackendType_DirectSound , fplAudioBackendType_Alsa ,
  fplAudioBackendType_First , fplAudioBackendType_Last
}
 An enumeration of audio backend types. More...
 
enum  fplAudioDefaultFields {
  fplAudioDefaultFields_None , fplAudioDefaultFields_BufferSize , fplAudioDefaultFields_SampleRate , fplAudioDefaultFields_Channels ,
  fplAudioDefaultFields_Periods , fplAudioDefaultFields_Type
}
 An enumeration of audio default fields. More...
 
enum  fplAudioFormatType {
  fplAudioFormatType_None , fplAudioFormatType_U8 , fplAudioFormatType_S16 , fplAudioFormatType_S24 ,
  fplAudioFormatType_S32 , fplAudioFormatType_S64 , fplAudioFormatType_F32 , fplAudioFormatType_F64 ,
  fplAudioFormatType_First , fplAudioFormatType_Last
}
 An enumeration of audio format types. More...
 
enum  fplAudioLatencyMode { fplAudioLatencyMode_Conservative , fplAudioLatencyMode_Low }
 An enumeration of audio latency modes. More...
 
enum  fplImageType { fplImageType_None , fplImageType_RGBA }
 An enumeration of image types. More...
 
enum  fplInitFlags {
  fplInitFlags_None , fplInitFlags_Console , fplInitFlags_Window , fplInitFlags_Video ,
  fplInitFlags_Audio , fplInitFlags_GameController , fplInitFlags_All
}
 An enumeration of initialization flags. More...
 
enum  fplMemoryAllocationMode { fplMemoryAllocationMode_Automatic , fplMemoryAllocationMode_Custom }
 A enumeration of dynamic memory allocation modes. More...
 
enum  fplOpenGLCompabilityFlags { fplOpenGLCompabilityFlags_Legacy , fplOpenGLCompabilityFlags_Core , fplOpenGLCompabilityFlags_Compability , fplOpenGLCompabilityFlags_Forward }
 An enumeration of OpenGL compability flags. More...
 
enum  fplPlatformResultType {
  fplPlatformResultType_FailedWindow , fplPlatformResultType_FailedAudio , fplPlatformResultType_FailedVideo , fplPlatformResultType_FailedPlatform ,
  fplPlatformResultType_FailedAllocatingMemory , fplPlatformResultType_AlreadyInitialized , fplPlatformResultType_NotInitialized , fplPlatformResultType_Success ,
  fplPlatformResultType_First , fplPlatformResultType_Last
}
 An enumeration of platform result types. More...
 
enum  fplPlatformType {
  fplPlatformType_Unknown , fplPlatformType_Windows , fplPlatformType_Linux , fplPlatformType_Unix ,
  fplPlatformType_First , fplPlatformType_Last
}
 An enumeration of platform types. More...
 
enum  fplVideoBackendType {
  fplVideoBackendType_None , fplVideoBackendType_Software , fplVideoBackendType_OpenGL , fplVideoBackendType_Vulkan ,
  fplVideoBackendType_First , fplVideoBackendType_Last
}
 An enumeration of video backend types. More...
 
enum  fplVulkanValidationLayerMode { fplVulkanValidationLayerMode_Disabled , fplVulkanValidationLayerMode_Optional , fplVulkanValidationLayerMode_Required }
 The validation layer modes for Vulkan. More...
 
enum  fplVulkanValidationSeverity {
  fplVulkanValidationSeverity_Off , fplVulkanValidationSeverity_Error , fplVulkanValidationSeverity_Warning , fplVulkanValidationSeverity_Info ,
  fplVulkanValidationSeverity_Verbose , fplVulkanValidationSeverity_All
}
 The validation layer logging severity for Vulkan. More...
 

Functions

 FPL_ENUM_AS_FLAGS_OPERATORS (fplAudioDefaultFields)
 fplAudioDefaultFields operator overloads for C++
 
 FPL_ENUM_AS_FLAGS_OPERATORS (fplInitFlags)
 InitFlags operator overloads for C++.
 
fpl_inline fplColor32 fplCreateColorRGBA (const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t a)
 Creates a fplColor32 from the specified r, g, b, a components.
 
fpl_common_api const fplSettingsfplGetCurrentSettings ()
 Gets the current settings.
 
fpl_common_api fplSettings fplMakeDefaultSettings ()
 Creates a full settings structure containing default values.
 
fpl_common_api const char * fplPlatformGetResultName (const fplPlatformResultType type)
 Gets the string representation of a platform result type.
 
fpl_common_api void fplSetDefaultAudioSettings (fplAudioSettings *audio)
 Resets the given audio settings to default settings (S16 PCM, 48 kHz, 2 Channels)
 
fpl_common_api void fplSetDefaultConsoleSettings (fplConsoleSettings *console)
 Resets the given console settings container to default settings.
 
fpl_common_api void 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.
 

Detailed Description

This category contains global settings structures/enumerations and functions to initialize/set them.

Typedef Documentation

◆ fpl_audio_client_read_callback

typedef uint32_t() fpl_audio_client_read_callback(const fplAudioDeviceFormat *deviceFormat, const uint32_t frameCount, void *outputSamples, void *userData)

A callback for reading audio samples from the client.

Parameters
deviceFormatThe pointer to the fplAudioDeviceFormat structure, the audio cards expects
frameCountThe numbers if frames the client should write at max
outputSamplesThe pointer to the target samples
userDataThe pointer to the user data specified in fplAudioSettings
Returns
Returns the number written frames
See also
Setting the client callback

Definition at line 3847 of file final_platform_layer.h.

◆ fpl_memory_allocate_callback

typedef void *() fpl_memory_allocate_callback(void *userData, const size_t size, const size_t alignment)

Custom memory allocation callback.

Definition at line 4044 of file final_platform_layer.h.

◆ fpl_memory_release_callback

typedef void() fpl_memory_release_callback(void *userData, void *ptr)

Custom memory release callback.

Definition at line 4046 of file final_platform_layer.h.

◆ fpl_window_event_callback

typedef bool() fpl_window_event_callback(const fplPlatformType platformType, void *windowState, void *rawEventData, void *userData)

A callback executed for each raw window event.

Parameters
platformTypeThe current fplPlatformType
windowStateThe opaque window state, mapping to fpl internal window state
rawEventDataThe raw event data structure for the current OS (XEvent for POSIX, MSG for Win32, etc.)
userDataThe pointer to the specific user data specified in fplWindowCallbacks
Returns
Needs to return true if the event is handled

Definition at line 3905 of file final_platform_layer.h.

◆ fpl_window_exposed_callback

A callback executed when the window needs to be exposed/repainted.

Parameters
platformTypeThe current fplPlatformType
windowStateThe opaque window state, mapping to internal window state
rawEventDataThe raw event data structure for the current OS (XEvent for POSIX, MSG for Win32, etc.)
userDataThe pointer to the specific user data specified in fplWindowCallbacks
Returns
Needs to return true, if the event is handled

Definition at line 3915 of file final_platform_layer.h.

◆ fplVulkanValidationLayerCallback

typedef void() fplVulkanValidationLayerCallback(void *userData, const char *message, const uint32_t messageSeverity, const uint32_t messageType, const void *debugUtilsMessengerCallbackData)

The debug callback called when the validation layer writes something.

Definition at line 3599 of file final_platform_layer.h.

Enumeration Type Documentation

◆ fplAudioBackendType

An enumeration of audio backend types.

Enumerator
fplAudioBackendType_None 

No audio backend.

fplAudioBackendType_Auto 

Auto detect.

fplAudioBackendType_DirectSound 

DirectSound.

fplAudioBackendType_Alsa 

ALSA.

fplAudioBackendType_First 

First fplAudioBackendType.

fplAudioBackendType_Last 

Last fplAudioBackendType.

Definition at line 3691 of file final_platform_layer.h.

◆ fplAudioDefaultFields

An enumeration of audio default fields.

Enumerator
fplAudioDefaultFields_None 

No default fields.

fplAudioDefaultFields_BufferSize 

Buffer size is default.

fplAudioDefaultFields_SampleRate 

Samples per seconds is default.

fplAudioDefaultFields_Channels 

Number of channels is default.

fplAudioDefaultFields_Periods 

Number of periods is default.

fplAudioDefaultFields_Type 

Audio format is default.

Definition at line 3733 of file final_platform_layer.h.

◆ fplAudioFormatType

An enumeration of audio format types.

Enumerator
fplAudioFormatType_None 

No audio format.

fplAudioFormatType_U8 

Unsigned 8-bit integer PCM.

fplAudioFormatType_S16 

Signed 16-bit integer PCM.

fplAudioFormatType_S24 

Signed 24-bit integer PCM.

fplAudioFormatType_S32 

Signed 32-bit integer PCM.

fplAudioFormatType_S64 

Signed 64-bit integer PCM.

fplAudioFormatType_F32 

32-bit IEEE_FLOAT

fplAudioFormatType_F64 

64-bit IEEE_FLOAT

fplAudioFormatType_First 

First fplAudioFormatType.

fplAudioFormatType_Last 

Last fplAudioFormatType.

Definition at line 3708 of file final_platform_layer.h.

◆ fplAudioLatencyMode

An enumeration of audio latency modes.

Enumerator
fplAudioLatencyMode_Conservative 

Conservative latency.

fplAudioLatencyMode_Low 

Low latency.

Definition at line 3751 of file final_platform_layer.h.

◆ fplImageType

An enumeration of image types.

Enumerator
fplImageType_None 

No image type.

fplImageType_RGBA 

RGBA image type.

Definition at line 3878 of file final_platform_layer.h.

◆ fplInitFlags

An enumeration of initialization flags.

Enumerator
fplInitFlags_None 

No init flags.

fplInitFlags_Console 

Create a console window.

fplInitFlags_Window 

Create a single window.

fplInitFlags_Video 

Use a video backbuffer (This flag ensures that fplInitFlags_Window is included always)

fplInitFlags_Audio 

Use asynchronous audio playback.

fplInitFlags_GameController 

Support for game controllers.

fplInitFlags_All 

All init flags.

Definition at line 3482 of file final_platform_layer.h.

◆ fplMemoryAllocationMode

A enumeration of dynamic memory allocation modes.

Enumerator
fplMemoryAllocationMode_Automatic 

Use OS memory allocation.

fplMemoryAllocationMode_Custom 

Use custom memory allocation.

Definition at line 4049 of file final_platform_layer.h.

◆ fplOpenGLCompabilityFlags

An enumeration of OpenGL compability flags.

Enumerator
fplOpenGLCompabilityFlags_Legacy 

Use legacy context.

fplOpenGLCompabilityFlags_Core 

Use core profile.

fplOpenGLCompabilityFlags_Compability 

Use compability profile.

fplOpenGLCompabilityFlags_Forward 

Remove features marked as deprecated.

Definition at line 3570 of file final_platform_layer.h.

◆ fplPlatformResultType

An enumeration of platform result types.

Enumerator
fplPlatformResultType_FailedWindow 

Window creation failed.

fplPlatformResultType_FailedAudio 

Audio initialization failed.

fplPlatformResultType_FailedVideo 

Video initialization failed.

fplPlatformResultType_FailedPlatform 

Platform initialization failed.

fplPlatformResultType_FailedAllocatingMemory 

Failed allocating required memory.

fplPlatformResultType_AlreadyInitialized 

Platform is already initialized.

fplPlatformResultType_NotInitialized 

Platform is not initialized.

fplPlatformResultType_Success 

Everything is fine.

fplPlatformResultType_First 

First fplPlatformResultType.

fplPlatformResultType_Last 

Last fplPlatformResultType.

Definition at line 3519 of file final_platform_layer.h.

◆ fplPlatformType

An enumeration of platform types.

Enumerator
fplPlatformType_Unknown 

Unknown platform.

fplPlatformType_Windows 

Windows platform.

fplPlatformType_Linux 

Linux platform.

fplPlatformType_Unix 

Unix platform.

fplPlatformType_First 

First fplPlatformType.

fplPlatformType_Last 

Last fplPlatformType.

Definition at line 3502 of file final_platform_layer.h.

◆ fplVideoBackendType

An enumeration of video backend types.

Enumerator
fplVideoBackendType_None 

No video backend.

fplVideoBackendType_Software 

Software.

fplVideoBackendType_OpenGL 

OpenGL.

fplVideoBackendType_Vulkan 

Vulkan.

fplVideoBackendType_First 

First fplVideoBackendType.

fplVideoBackendType_Last 

Last fplVideoBackendType.

Definition at line 3552 of file final_platform_layer.h.

◆ fplVulkanValidationLayerMode

The validation layer modes for Vulkan.

Enumerator
fplVulkanValidationLayerMode_Disabled 

Do not use the validation.

fplVulkanValidationLayerMode_Optional 

Enable validations when its possible.

fplVulkanValidationLayerMode_Required 

Enable validations and stop when its not supported.

Definition at line 3602 of file final_platform_layer.h.

◆ fplVulkanValidationSeverity

The validation layer logging severity for Vulkan.

Enumerator
fplVulkanValidationSeverity_Off 

Log nothing.

fplVulkanValidationSeverity_Error 

Log error only.

fplVulkanValidationSeverity_Warning 

Log warning and error.

fplVulkanValidationSeverity_Info 

Log warning, error, infos.

fplVulkanValidationSeverity_Verbose 

Log warning, error, info, verbose.

fplVulkanValidationSeverity_All 

Log out everything.

Definition at line 3612 of file final_platform_layer.h.

Function Documentation

◆ fplCreateColorRGBA()

fpl_inline fplColor32 fplCreateColorRGBA ( const uint8_t  r,
const uint8_t  g,
const uint8_t  b,
const uint8_t  a 
)

Creates a fplColor32 from the specified r, g, b, a components.

Parameters
rThe red component in range of 0-255
gThe green component in range of 0-255
bThe blue component in range of 0-255
aThe alpha component in range of 0-255
Returns
The resulting fplColor32

Definition at line 3971 of file final_platform_layer.h.

◆ fplGetCurrentSettings()

fpl_common_api const fplSettings * fplGetCurrentSettings ( )

Gets the current settings.

Returns
Returns a pointer to the fplSettings structure
See also
Tips

◆ fplMakeDefaultSettings()

fpl_common_api fplSettings fplMakeDefaultSettings ( )

Creates a full settings structure containing default values.

Returns
Returns a defaulted fplSettings structure
See also
Tips

◆ fplPlatformGetResultName()

fpl_common_api const char * fplPlatformGetResultName ( const fplPlatformResultType  type)

Gets the string representation of a platform result type.

Parameters
typeThe platform result type as fplPlatformResultType
Returns
Returns the string representation of a platform result type.
See also
Result/Error checking

◆ fplSetDefaultAudioSettings()

fpl_common_api void fplSetDefaultAudioSettings ( fplAudioSettings audio)

Resets the given audio settings to default settings (S16 PCM, 48 kHz, 2 Channels)

Parameters
audioThe target fplAudioSettings structure
Note
This will not change any audio settings! To change the actual settings you have to pass the entire fplSettings container to an argument in fplPlatformInit().
See also
Notes

◆ fplSetDefaultConsoleSettings()

fpl_common_api void fplSetDefaultConsoleSettings ( fplConsoleSettings console)

Resets the given console settings container to default settings.

Parameters
consoleThe target fplConsoleSettings structure
Note
This will not change any console settings! To change the actual settings you have to pass the entire fplSettings container to an argument in fplPlatformInit().

◆ fplSetDefaultInputSettings()

fpl_common_api void fplSetDefaultInputSettings ( fplInputSettings input)

Resets the given input settings container to default values.

Parameters
inputThe target fplInputSettings structure
Note
This will not change any input settings! To change the actual settings you have to pass the entire fplSettings container to an argument in fplPlatformInit().
See also
Input configuration

◆ fplSetDefaultSettings()

fpl_common_api void fplSetDefaultSettings ( fplSettings settings)

Resets the given settings container to default values for window, video, audio, etc.

Parameters
settingsThe target fplSettings structure
Note
This will not change the active settings! To change the actual settings you have to pass this settings container to an argument in fplPlatformInit().
See also
Initialization with custom settings

◆ fplSetDefaultVideoSettings()

fpl_common_api void fplSetDefaultVideoSettings ( fplVideoSettings video)

Resets the given video settings to default values.

Parameters
videoThe target fplVideoSettings structure
Note
This will not change any video settings! To change the actual settings you have to pass the entire fplSettings container as an argument in fplPlatformInit().
See also
Notes

◆ fplSetDefaultWindowSettings()

fpl_common_api void fplSetDefaultWindowSettings ( fplWindowSettings window)

Resets the given window settings container to default settings.

Parameters
windowThe target fplWindowSettings structure
Note
This will not change any window settings! To change the actual settings you have to pass the entire fplSettings container to an argument in fplPlatformInit().
See also
Notes