Example #1
0
	void LoadCEF3Modules()
	{
#if PLATFORM_WINDOWS
	#if PLATFORM_64BITS
		FString DllPath(FPaths::Combine(*FPaths::EngineDir(), TEXT("Binaries/ThirdParty/CEF3/Win64")));
	#else
		FString DllPath(FPaths::Combine(*FPaths::EngineDir(), TEXT("Binaries/ThirdParty/CEF3/Win32")));
	#endif

		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_47.dll")));
	#else
		D3DHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("d3dcompiler_43.dll")));
	#endif
		MPEGHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("ffmpegsumo.dll")));
		GLESHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("libGLESv2.dll")));
		EGLHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("libEGL.dll")));
#endif
	}
//------------------------------------------------------------------------
void FNeuronReaderModule::StartupModule()
{
	// load dynamic libraries
#if PLATFORM_WINDOWS
#if PLATFORM_64BITS
	FString DllPath(FPaths::Combine(*FPaths::EngineDir(), TEXT("Binaries/ThirdParty/NeuronDataReaderSDK/Windows/x64")));
#else
	FString DllPath(FPaths::Combine(*FPaths::EngineDir(), TEXT("Binaries/ThirdParty/NeuronDataReaderSDK/Windows/x86")));
#endif
	DllHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("NeuronDataReader.dll")));
#elif PLATFORM_MAC
	DllHandle = FPlatformProcess::GetDllHandle(TEXT("NeuronDataReader.dylib"));
#endif

	// not found in engine binaries, try it in game binaries.
	if (DllHandle == nullptr)
	{
#if PLATFORM_WINDOWS
#if PLATFORM_64BITS
		FString DllPath(FPaths::Combine(*FPaths::GameDir(), TEXT("Binaries/ThirdParty/NeuronDataReaderSDK/Windows/x64")));
#else
		FString DllPath(FPaths::Combine(*FPaths::GameDir(), TEXT("Binaries/ThirdParty/NeuronDataReaderSDK/Windows/x86")));
#endif
		DllHandle = FPlatformProcess::GetDllHandle(*FPaths::Combine(*DllPath, TEXT("NeuronDataReader.dll")));
#elif PLATFORM_MAC
		DllHandle = FPlatformProcess::GetDllHandle(TEXT("NeuronDataReader.dylib"));
#endif
	}

	// TODO noslopforever : if dll is not valid, disable all functional and error output!
	if (DllHandle == nullptr)
	{
		return;
	}

	// Create singleton
	NeuronReaderSingleton = new FNeuronReaderSingleton();
}
Example #3
0
/*
	Get Dll Handle & C# Function Address
*/
bool UHGGifFactory::GenerateConverterDll()
{
	if (GeneratedDllHandle == nullptr)
	{
		TSharedPtr<IPlugin> PluginPtr = IPluginManager::Get().FindPlugin(TEXT("HGGifImporter"));
		if (PluginPtr.Get() != nullptr)
		{
			FString DllPath(TEXT(""));
			DllPath = FPaths::Combine(*(PluginPtr->GetBaseDir()), TEXT("Source/ThirdParty/GifConverter/Dll/Release/"), TEXT("GifConverter.dll"));
			if (FPaths::FileExists(DllPath))
			{
				GeneratedDllHandle = FPlatformProcess::GetDllHandle(*DllPath); // Retrieve the DLL.
				if (GeneratedDllHandle != nullptr)
				{
					static FString procName = TEXT("DecodeGifToFrame"); // The exact name of the DLL function.
					GifDecodeFunction = (_DecodeFunction)FPlatformProcess::GetDllExport(GeneratedDllHandle, *procName); // Export the DLL function.
				}
			}
		}
	}

	return (GifDecodeFunction != nullptr) ? true : false;
}