SpoutModule.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Some copyright should be here...
  2. #include "SpoutPluginPrivatePCH.h"
  3. #include "Core.h"
  4. #include "ModuleManager.h"
  5. //#include "IPluginManager.h"
  6. DEFINE_LOG_CATEGORY(SpoutLog);
  7. #define LOCTEXT_NAMESPACE "FSpoutModule"
  8. void FSpoutModule::StartupModule()
  9. {
  10. /// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
  11. // Get the base directory of this plugin
  12. //FString BaseDir = IPluginManager::Get().FindPlugin("SpoutUE4")->GetBaseDir();
  13. /*
  14. // Add on the relative location of the third party dll and load it
  15. FString LibraryPath;
  16. #if PLATFORM_WINDOWS
  17. LibraryPath = FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/SpoutUE4Library/Win64/Spout.dll"));
  18. #elif PLATFORM_MAC
  19. //LibraryPath = FPaths::Combine(*BaseDir, TEXT("Source/ThirdParty/SpoutUE4Library/Mac/Release/libExampleLibrary.dylib"));
  20. #endif // PLATFORM_WINDOWS
  21. ExampleLibraryHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr;
  22. if (ExampleLibraryHandle)
  23. {
  24. UE_LOG(SpoutLog, Warning, TEXT("Modulo Spout Cargado"));
  25. // Call the test function in the third party library that opens a message box
  26. //ExampleLibraryFunction();
  27. }
  28. else
  29. {
  30. FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("ThirdPartyLibraryError", "Failed to load example third party library"));
  31. }*/
  32. UE_LOG(SpoutLog, Warning, TEXT("Modulo Spout Cargado"));
  33. }
  34. void FSpoutModule::ShutdownModule()
  35. {
  36. // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
  37. // we call this function before unloading the module.
  38. // Free the dll handle
  39. /*FPlatformProcess::FreeDllHandle(ExampleLibraryHandle);
  40. ExampleLibraryHandle = nullptr;*/
  41. UE_LOG(SpoutLog, Warning, TEXT("Modulo Spout Descargado"));
  42. }
  43. IMPLEMENT_MODULE(FSpoutModule, SpoutPlugin)
  44. #undef LOCTEXT_NAMESPACE