graphic settings wip

This commit is contained in:
Oleg Petruny 2025-01-06 07:00:54 +01:00
parent 2c055a8502
commit fbd5dddcc9
38 changed files with 119 additions and 63 deletions

Binary file not shown.

View File

@ -2,14 +2,16 @@
using UnrealBuildTool; using UnrealBuildTool;
public class Lost_Edge : ModuleRules { public class Lost_Edge : ModuleRules
public Lost_Edge(ReadOnlyTargetRules Target) : base(Target) { {
public Lost_Edge(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OpenCV" }); PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OpenCV" });
PrivateDependencyModuleNames.AddRange(new string[] { "EnhancedInput", "UMG", "RHI", "RenderCore", "Lost_EdgeShaders", "PakFile", //"TextureCompressor", PrivateDependencyModuleNames.AddRange(new string[] { "EnhancedInput", "UMG", "RHI", "RenderCore", "Lost_EdgeShaders", "PakFile", //"TextureCompressor",
"LevelSequence", "MovieScene", "HTTP", "Json" }); // "Slate", "SlateCore" "LevelSequence", "MovieScene", "HTTP", "Json", "ApplicationCore" }); // "Slate", "SlateCore"
// UE_LOG(LogTemp, Log, TEXT("capture: %s"), (capture ? TEXT("true") : TEXT("false"))); // UE_LOG(LogTemp, Log, TEXT("capture: %s"), (capture ? TEXT("true") : TEXT("false")));
// GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("1")); // GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("1"));

View File

@ -0,0 +1,37 @@
// Oleg Petruny proprietary.
#include "GraphicsSettingsHelper.h"
#include "GenericPlatform/GenericApplication.h"
int32 UGraphicsSettingsHelper::GetPrimaryMonitorId()
{
FDisplayMetrics FDM;
FDisplayMetrics::GetMonitorsInfo(FDM);
TArray<FMonitorInfo> buffer;
for(const FMonitorInfo& i : FDM.MonitorInfo)
{
buffer.Add(FMonitorInfo(i.Name, i.ID, i.NativeWidth, i.NativeHeight,
FPlatformRectangle(i.DisplayRect.Left, i.DisplayRect.Top, i.DisplayRect.Right, i.DisplayRect.Bottom),
FPlatformRectangle(i.WorkArea.Left, i.WorkArea.Top, i.WorkArea.Right, i.WorkArea.Bottom),
i.bIsPrimary, i.DPI));
}
monitors = buffer;
TArray<FMonitorInfo> monitors = GetAvailableMonitors();
for(int i = 0; i < monitors.Num(); i++)
if(monitors[i].bIsPrimary)
return i;
}
int32 UGraphicsSettingsHelper::GetCurrentMonitorId()
{
return int32();
}
//TArray<FMonitorInfo> UGraphicsSettingsHelper::GetAvailableMonitors()
//{
// return TArray<FMonitorInfo>();
//}
void UGraphicsSettingsHelper::SetMonitor(int32 id)
{}

View File

@ -0,0 +1,23 @@
// Oleg Petruny proprietary.
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "GraphicsSettingsHelper.generated.h"
UCLASS()
class UGraphicsSettingsHelper : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintPure, Category = GraphicsSettingsHelper)
static int32 GetPrimaryMonitorId();
UFUNCTION(BlueprintPure, Category = GraphicsSettingsHelper)
static int32 GetCurrentMonitorId();
//UFUNCTION(BlueprintPure, Category = GraphicsSettingsHelper)
//static TArray<FMonitorInfo> GetAvailableMonitors();
UFUNCTION(BlueprintCallable, Category = GraphicsSettingsHelper)
static void SetMonitor(int32 id);
};