Files
UnrealEngineUWP/Engine/Source/Developer/AllDesktopTargetPlatform/Private/AllDesktopTargetPlatformModule.cpp
Josh Adams 7efc6ca8c4 - Merged from FN/Main to 4.23:
- Added early check before creating a TargetPlatform object if the PlatformInfo will be found (check a static function to see if it's usable before making it)
- Changed each platform's GetTargetPlatform[s] function
#rb none
#jira UE-78692

[CL 8031412 by Josh Adams in 4.23 branch]
2019-08-14 11:13:59 -04:00

61 lines
1.1 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include "Interfaces/ITargetPlatformModule.h"
#include "AllDesktopTargetPlatform.h"
/**
* Holds the target platform singleton.
*/
static ITargetPlatform* Singleton = NULL;
/**
* Module for a generic target platform for desktop platforms
*/
class FAllDesktopTargetPlatformModule : public ITargetPlatformModule
{
public:
/**
* Destructor.
*/
FAllDesktopTargetPlatformModule()
{
Singleton = NULL;
}
public:
// Begin ITargetPlatformModule interface
virtual ITargetPlatform* GetTargetPlatform() override
{
if (Singleton == NULL && FAllDesktopTargetPlatform::IsUsable())
{
Singleton = new FAllDesktopTargetPlatform();
}
return Singleton;
}
// End ITargetPlatformModule interface
public:
// Begin IModuleInterface interface
virtual void StartupModule() override
{
}
virtual void ShutdownModule() override
{
}
// End IModuleInterface interface
};
IMPLEMENT_MODULE( FAllDesktopTargetPlatformModule, AllDesktopTargetPlatform);