#include "SkyPortalSubsystem.h"
#include "Engine/Engine.h"
#include "hidapi.h"

void USkyPortalSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
	Super::Initialize(Collection);
	// Custom initialization logic
	UE_LOG(LogTemp, Warning, TEXT("SkyPortalSubsystem Initialized"));

	// Initialize HIDAPI
	int res = hid_init();
	if (res == 0)
	{
		UE_LOG(LogTemp, Log, TEXT("HIDAPI initialized successfully."));
	}
	else
	{
		UE_LOG(LogTemp, Error, TEXT("Failed to initialize HIDAPI."));
	}

}

void USkyPortalSubsystem::Deinitialize()
{
	// Custom cleanup logic

	UE_LOG(LogTemp, Warning, TEXT("SkyPortalSubsystem Deinitialized"));
	Super::Deinitialize();
}