-
Notifications
You must be signed in to change notification settings - Fork 13
Query Hardware information
- Get number of CPU-Cores
- Get CPU architecture
- Get the CPU Name
- Query memory state
- Query CPU Capabilities
FPL provides a couple of functions for retrieving hardware information, such as CPU & memory infos, etc.
You can retrieve the number of processor cores by calling fplCPUGetCoreCount() .
size_t coreCount = ();
// Do something with the core countNote: Hyperthreads will be included as well, so on a typical 4-core HT CPU, this function will return eight cores.
You can query the CPU architecture type by calling fplCPUGetArchitecture() . This will return a fplCPUArchType value, which you can use to test for different architecture types. Use fplCPUGetArchName() to convert a fplCPUArchType into a string.
cpuArch = ();
if (cpuArch == ) {
// Do something on a ARM-64 CPU
}
// or just print it out
const char *cpuArchString = (cpuArch);
("CPU Architecture: %s\n", cpuArchString);You can query the CPU name by calling fplCPUGetName() .
// Print out the CPU-Name
char nameBuffer[1024];
(nameBuffer, (nameBuffer));
("CPU Name: %s\n", nameBuffer);With fplMemoryGetUsage() you can query the current memory state. This includes the size of the physical memory, the current memory usage, and more. See fplMemoryInfos for more details.
memInfos = ;
if ((&memInfos)) {
("%llu of %llu physical memory is available.\n", memInfos., memInfos.);
}Use the fplCPUGetCapabilities() to retrieve a full set of available processor capabilities, like MMX/SSE/AVX support, etc.
caps = ;
if ((&caps)) {
if (caps..) {
// Do something when the x86 CPU supports SSE2 - this should be true, on most modern x86 CPUs.
}
}- 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