====== CPUとGPUを取得 ======
Windows向け\\
===== 参考 =====
[[https://www.reddit.com/r/unrealengine/comments/1kbbo1o/getting_hardware_information_in_c/|Getting hardware information in C++]]\\
[[https://forums.unrealengine.com/t/can-i-get-the-gpu-and-cpu-name-in-bp/46762|Can i get the gpu and cpu name in bp?]]\\
===== 内容 =====
=== HardwareFunctions.h ===
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "HardwareFunctions.generated.h"
UCLASS()
class ***_API UHardwareFunctions : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintPure, meta = (DisplayName = "Get CPU Brand Name", Keywords = "CPU brand"), Category = Hardware)
static FString GetCPUBrandName();
UFUNCTION(BlueprintPure, meta = (DisplayName = "Get GPU Brand Name", Keywords = "GPU brand"), Category = Hardware)
static FString GetGPUBrandName();
};
=== HardwareFunctions.cpp ===
#include "HardwareFunctions.h"
FString UHardwareFunctions::GetCPUBrandName()
{
return FWindowsPlatformMisc::GetCPUBrand();
}
FString UHardwareFunctions::GetGPUBrandName()
{
return FWindowsPlatformMisc::GetPrimaryGPUBrand();
}