You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Web Browser widget displays a web page and allows for some optional basic controls. Added initialisation and update of Web Browser module to Slate Application so that each web browser window doesn't have to manage this individually. Added example usage of the widget to STestSuite so that it can be used via the SlateViewer app. Fixed error in name of CEF3Utils module. [CL 2319730 by Matthew Griffin in Main branch]
67 lines
2.1 KiB
C++
67 lines
2.1 KiB
C++
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "CEF3UtilsPrivatePCH.h"
|
|
|
|
DEFINE_LOG_CATEGORY(LogCEF3Utils);
|
|
|
|
IMPLEMENT_MODULE(FDefaultModuleImpl, CEF3Utils);
|
|
|
|
#if WITH_CEF3
|
|
namespace CEF3Utils
|
|
{
|
|
#if PLATFORM_WINDOWS
|
|
void* CEF3DLLHandle = nullptr;
|
|
void* D3DHandle = nullptr;
|
|
void* MPEGHandle = nullptr;
|
|
void* ICUDTHandle = nullptr;
|
|
void* GLESHandle = nullptr;
|
|
void* EGLHandle = nullptr;
|
|
#endif
|
|
|
|
void LoadCEF3Modules()
|
|
{
|
|
#if PLATFORM_WINDOWS
|
|
FString DllPath(FPaths::Combine(*FPaths::EngineDir(), TEXT("Binaries/ThirdParty/CEF3/Win64")));
|
|
|
|
CEF3DLLHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("libcef.dll")));
|
|
if (CEF3DLLHandle == NULL)
|
|
{
|
|
int32 ErrorNum = FPlatformMisc::GetLastError();
|
|
TCHAR ErrorMsg[1024];
|
|
FPlatformMisc::GetSystemErrorMessage(ErrorMsg, 1024, ErrorNum);
|
|
UE_LOG(LogCEF3Utils, Error, TEXT("Failed to get CEF3 DLL handle: %s (%d)"), ErrorMsg, ErrorNum);
|
|
}
|
|
|
|
#if WINVER >= 0x600 // Different dll used pre-Vista
|
|
D3DHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("d3dcompiler_46.dll")));
|
|
#else
|
|
D3DHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("d3dcompiler_43.dll")));
|
|
#endif
|
|
MPEGHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("ffmpegsumo.dll")));
|
|
ICUDTHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("icudt.dll")));
|
|
GLESHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("libGLESv2.dll")));
|
|
EGLHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("libEGL.dll")));
|
|
#endif
|
|
}
|
|
|
|
void UnloadCEF3Modules()
|
|
{
|
|
#if PLATFORM_WINDOWS
|
|
FPlatformProcess::FreeDllHandle(CEF3DLLHandle);
|
|
CEF3DLLHandle = nullptr;
|
|
|
|
FPlatformProcess::FreeDllHandle(D3DHandle);
|
|
D3DHandle = nullptr;
|
|
FPlatformProcess::FreeDllHandle(MPEGHandle);
|
|
MPEGHandle = nullptr;
|
|
FPlatformProcess::FreeDllHandle(ICUDTHandle);
|
|
ICUDTHandle = nullptr;
|
|
FPlatformProcess::FreeDllHandle(GLESHandle);
|
|
GLESHandle = nullptr;
|
|
FPlatformProcess::FreeDllHandle(EGLHandle);
|
|
EGLHandle = nullptr;
|
|
#endif
|
|
}
|
|
};
|
|
#endif //WITH_CEF3
|