DynamicLoader.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #pragma once
  2. #include "Core.h"
  3. #include "Engine.h"
  4. #include "CoreMinimal.h"
  5. #include "UObject/NoExportTypes.h"
  6. #include "PixelFormat.h"
  7. #include "DynamicLoader.generated.h"
  8. // Forward declarations
  9. class UTexture2D;
  10. DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnImageLoadCompleted, UTexture2D*, Texture, FString, ID);
  11. UCLASS()
  12. class UImageLoader : public UObject
  13. {
  14. GENERATED_BODY()
  15. public:
  16. static UTexture2D* LoadImageFromDisk(const FString& ImagePath);
  17. public:
  18. UPROPERTY(BlueprintAssignable, Category = ImageLoader, meta = (AllowPrivateAccess = true))
  19. FOnImageLoadCompleted LoadCompleted;
  20. /** This accessor function allows C++ code to bind to the event. */
  21. //FOnImageLoadCompleted& OnLoadCompleted()
  22. //{
  23. // return LoadCompleted;
  24. //}
  25. /** Helper function that initiates the loading operation and fires the event when loading is done. */
  26. void LoadImageAsync(const FString& ImagePath,const FString& ID);
  27. private:
  28. /**
  29. Holds the load completed event delegate.
  30. Giving Blueprint access to this private variable allows Blueprint scripts to bind to the event.
  31. */
  32. FString LoadID;
  33. /** Holds the future value which represents the asynchronous loading operation. */
  34. TFuture<UTexture2D*> Future;
  35. };
  36. UCLASS()
  37. class AExeActor : public AActor
  38. {
  39. GENERATED_BODY()
  40. public:
  41. AExeActor();
  42. protected:
  43. // Called when the game starts or when spawned
  44. virtual void BeginPlay() override;
  45. public:
  46. virtual void Tick(float DeltaTime) override;
  47. UFUNCTION(BlueprintCallable, meta = (Keywords = "FFMPEGPort sample test testing"), Category = "FFMPEGPortTesting")
  48. bool Getstat();
  49. DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnProcShutdown, bool, IsOver);
  50. UPROPERTY(BlueprintAssignable, Category = "BlueprintUtility|OS", meta = (AllowPrivateAccess = true))
  51. FOnProcShutdown ProcShutdown;
  52. public:
  53. bool bisShutDown = false;
  54. FProcHandle CheckProc;
  55. };