Yes, added the NoExportTypes.h. Not sure what the point of that is, but it’s in there. Now I get a ton of new errors. Here’e the cpp as well. I can’t believe this is so much trouble. The errors are even misleading because of the Unreal Macros jacking up the syntax.
#pragma once
#include “UObject/NoExportTypes.h”
#include “Display.generated.h”
USTRUCT(BlueprintType)
struct FDisplayInfo
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = DisplayInfo)
int32 Width;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = DisplayInfo)
int32 Height;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = DisplayInfo)
int32 RefreshRate;
FDisplayInfo()
{
Width = Height = RefreshRate = 0;
}
};
UCLASS(Blueprintable)
class CARZ_API UDisplay : public UObject
{
GENERATED_BODY()
public:
UDisplay();
UFUNCTION(BlueprintPure, Category = Utility)
static TArray<struct FDisplayInfo> GetDisplayResolutions();
};
#include “Carz.h”
#include “Display.h”
UDisplay::UDisplay()
{
}
TArray<FDisplayInfo> UDisplay::GetDisplayResolutions()
{
TArray<FDisplayInfo> ResolutionsToReturn;
FScreenResolutionArray Resolutions;
if (RHIGetAvailableResolutions(Resolutions, false))
{
// Preallocate just enough memory to store all elements
ResolutionsToReturn.Reserve(Resolutions.Num());
for (const FScreenResolutionRHI& EachResolution : Resolutions)
{
FDisplayInfo Info;
Info.Width = EachResolution.Width;
Info.Height = EachResolution.Height;
Info.RefreshRate = EachResolution.RefreshRate;
ResolutionsToReturn.Add(Info);
}
}
return ResolutionsToReturn;
}