VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
vex::HardwareInfo Class Reference

Utility class for retrieving and storing hardware and driver information. More...

#include <HardwareInfo.hpp>

Static Public Member Functions

static std::string GetCPUName ()
 Retrieves the name of the CPU.
static std::string GetSystemMemory ()
 Retrieves the total amount of system memory.
static bool HasAVX2 ()
 Checks if the CPU supports the AVX2 instruction set.
static void SetGPUInfo (const std::string &name, uint32_t vendorID, uint32_t driverVersion)
 Sets the stored GPU information.
static std::string GetGPUName ()
 Retrieves the name of the GPU.
static std::string GetDriverVersion ()
 Retrieves the GPU driver version.
static void SetVulkanVersions (const std::string &deviceVer, const std::string &requestedVer)
 Sets the Vulkan API versions.
static std::string GetVulkanDeviceVersion ()
 Retrieves the Vulkan version supported by the device.
static std::string GetVulkanRequestedVersion ()
 Retrieves the Vulkan version requested by the engine.
static void SetVulkanFeatures (const VulkanFeatures &features)
 Sets the active Vulkan features.
static VulkanFeatures GetVulkanFeatures ()
 Retrieves the active Vulkan features.
static void PrintCrashDump (int fd)
 Prints hardware information to a crash dump file descriptor.

Static Private Member Functions

static void CpuId (int info[4], int function_id)
static void DetectCPUName ()
static void DetectSystemMemory ()
static bool CheckHardwareSupport ()

Static Private Attributes

static std::string CPUName = ""
static std::string SystemMemory = ""
static std::string GPUName = "Unknown GPU"
static std::string DriverVersion = "Unknown"
static std::string VulkanDeviceVersion = "0.0.0"
static std::string VulkanRequestedVersion = "0.0.0"
static VulkanFeatures GPUFeatures = {}

Detailed Description

Utility class for retrieving and storing hardware and driver information.

Definition at line 24 of file HardwareInfo.hpp.

Member Function Documentation

◆ CheckHardwareSupport()

bool vex::HardwareInfo::CheckHardwareSupport ( )
staticprivate

Definition at line 176 of file HardwareInfo.cpp.

◆ CpuId()

void vex::HardwareInfo::CpuId ( int info[4],
int function_id )
inlinestaticprivate

Definition at line 86 of file HardwareInfo.hpp.

◆ DetectCPUName()

void vex::HardwareInfo::DetectCPUName ( )
staticprivate

Definition at line 126 of file HardwareInfo.cpp.

◆ DetectSystemMemory()

void vex::HardwareInfo::DetectSystemMemory ( )
staticprivate

Definition at line 153 of file HardwareInfo.cpp.

◆ GetCPUName()

std::string vex::HardwareInfo::GetCPUName ( )
static

Retrieves the name of the CPU.

Returns
std::string - The CPU model name.

Definition at line 116 of file HardwareInfo.cpp.

◆ GetDriverVersion()

std::string vex::HardwareInfo::GetDriverVersion ( )
static

Retrieves the GPU driver version.

Returns
std::string - The driver version string.

Definition at line 102 of file HardwareInfo.cpp.

◆ GetGPUName()

std::string vex::HardwareInfo::GetGPUName ( )
static

Retrieves the name of the GPU.

Returns
std::string - The GPU name.

Definition at line 101 of file HardwareInfo.cpp.

◆ GetSystemMemory()

std::string vex::HardwareInfo::GetSystemMemory ( )
static

Retrieves the total amount of system memory.

Returns
std::string - The total system memory formatted as a string.

Definition at line 121 of file HardwareInfo.cpp.

◆ GetVulkanDeviceVersion()

std::string vex::HardwareInfo::GetVulkanDeviceVersion ( )
static

Retrieves the Vulkan version supported by the device.

Returns
std::string - The device Vulkan version.

Definition at line 108 of file HardwareInfo.cpp.

◆ GetVulkanFeatures()

VulkanFeatures vex::HardwareInfo::GetVulkanFeatures ( )
static

Retrieves the active Vulkan features.

Returns
VulkanFeatures - The currently stored Vulkan features.

Definition at line 114 of file HardwareInfo.cpp.

◆ GetVulkanRequestedVersion()

std::string vex::HardwareInfo::GetVulkanRequestedVersion ( )
static

Retrieves the Vulkan version requested by the engine.

Returns
std::string - The requested Vulkan version.

Definition at line 109 of file HardwareInfo.cpp.

◆ HasAVX2()

bool vex::HardwareInfo::HasAVX2 ( )
static

Checks if the CPU supports the AVX2 instruction set.

Returns
bool - True if AVX2 is supported, false otherwise.

Definition at line 200 of file HardwareInfo.cpp.

◆ PrintCrashDump()

void vex::HardwareInfo::PrintCrashDump ( int fd)
static

Prints hardware information to a crash dump file descriptor.

Parameters
fdThe file descriptor to write to.

Definition at line 30 of file HardwareInfo.cpp.

◆ SetGPUInfo()

void vex::HardwareInfo::SetGPUInfo ( const std::string & name,
uint32_t vendorID,
uint32_t driverVersion )
static

Sets the stored GPU information.

Parameters
nameThe name of the GPU device.
vendorIDThe vendor ID of the GPU.
driverVersionThe driver version of the GPU.

Definition at line 97 of file HardwareInfo.cpp.

◆ SetVulkanFeatures()

void vex::HardwareInfo::SetVulkanFeatures ( const VulkanFeatures & features)
static

Sets the active Vulkan features.

Parameters
featuresThe Vulkan features structure.

Definition at line 111 of file HardwareInfo.cpp.

◆ SetVulkanVersions()

void vex::HardwareInfo::SetVulkanVersions ( const std::string & deviceVer,
const std::string & requestedVer )
static

Sets the Vulkan API versions.

Parameters
deviceVerThe version supported by the device.
requestedVerThe version requested by the engine.

Definition at line 104 of file HardwareInfo.cpp.

Member Data Documentation

◆ CPUName

std::string vex::HardwareInfo::CPUName = ""
staticprivate

Definition at line 77 of file HardwareInfo.hpp.

◆ DriverVersion

std::string vex::HardwareInfo::DriverVersion = "Unknown"
staticprivate

Definition at line 81 of file HardwareInfo.hpp.

◆ GPUFeatures

VulkanFeatures vex::HardwareInfo::GPUFeatures = {}
staticprivate

Definition at line 84 of file HardwareInfo.hpp.

◆ GPUName

std::string vex::HardwareInfo::GPUName = "Unknown GPU"
staticprivate

Definition at line 80 of file HardwareInfo.hpp.

◆ SystemMemory

std::string vex::HardwareInfo::SystemMemory = ""
staticprivate

Definition at line 78 of file HardwareInfo.hpp.

◆ VulkanDeviceVersion

std::string vex::HardwareInfo::VulkanDeviceVersion = "0.0.0"
staticprivate

Definition at line 82 of file HardwareInfo.hpp.

◆ VulkanRequestedVersion

std::string vex::HardwareInfo::VulkanRequestedVersion = "0.0.0"
staticprivate

Definition at line 83 of file HardwareInfo.hpp.


The documentation for this class was generated from the following files: