separate the unreal c++/bp implementation of SGConnect wrappers
This commit is contained in:
@@ -34,20 +34,21 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "SGConnect/SGConnect.h"
|
#include "SGConnect/SGConnect.h"
|
||||||
|
|
||||||
#include "SGConnectImpl/SGExportedFunctions.h"
|
#include "SGConnectImpl/SGExportedFunctions.h"
|
||||||
#include "SGInterop/SGIC_FString.h"
|
#include "SGInterop/SGIC_FString.h"
|
||||||
|
|
||||||
int32 USGConnect::Init()
|
int32 FSGConnect::Init()
|
||||||
{
|
{
|
||||||
return SGConnect_Init();
|
return SGConnect_Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 USGConnect::Dispose()
|
int32 FSGConnect::Dispose()
|
||||||
{
|
{
|
||||||
return SGConnect_Dispose();
|
return SGConnect_Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
FString USGConnect::GetLibraryVersion()
|
FString FSGConnect::GetLibraryVersion()
|
||||||
{
|
{
|
||||||
FSGIC_FString Container;
|
FSGIC_FString Container;
|
||||||
SGConnect_GetLibraryVersion(&Container);
|
SGConnect_GetLibraryVersion(&Container);
|
||||||
|
|||||||
@@ -37,4 +37,4 @@
|
|||||||
#include "Modules/ModuleManager.h"
|
#include "Modules/ModuleManager.h"
|
||||||
#include "SenseGloveConnectModule.h"
|
#include "SenseGloveConnectModule.h"
|
||||||
|
|
||||||
IMPLEMENT_MODULE(FSenseGloveConnectModule, SenseGloveConnect)
|
IMPLEMENT_MODULE(FSenseGloveConnectModule, SenseGloveConnect)
|
||||||
@@ -35,4 +35,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
@@ -43,8 +43,8 @@
|
|||||||
void FSenseGloveConnectModule::StartupModule()
|
void FSenseGloveConnectModule::StartupModule()
|
||||||
{
|
{
|
||||||
SGLOG("Starting up SenseGloveConnect module...");
|
SGLOG("Starting up SenseGloveConnect module...");
|
||||||
SGLOG(FString::Printf(TEXT("The Unreal Engine implementation of '%s' has been loaded successfully!"), *USGConnect::
|
SGLOG(FString::Printf(TEXT("The Unreal Engine implementation of '%s' has been loaded successfully!"),
|
||||||
GetLibraryVersion()));
|
*FSGConnect::GetLibraryVersion()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FSenseGloveConnectModule::PreUnloadCallback()
|
void FSenseGloveConnectModule::PreUnloadCallback()
|
||||||
|
|||||||
@@ -48,4 +48,4 @@ public:
|
|||||||
virtual void ShutdownModule() override;
|
virtual void ShutdownModule() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef LOCTEXT_NAMESPACE
|
#undef LOCTEXT_NAMESPACE
|
||||||
@@ -35,12 +35,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "UObject/Object.h"
|
|
||||||
#include "UObject/ObjectMacros.h"
|
#include "UObject/ObjectMacros.h"
|
||||||
|
|
||||||
#include "SGConnect.generated.h"
|
#include "SGConnect.generated.h"
|
||||||
|
|
||||||
UCLASS(BlueprintType)
|
USTRUCT()
|
||||||
class SENSEGLOVECONNECT_API USGConnect: public UObject
|
struct SENSEGLOVECONNECT_API FSGConnect
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
@@ -55,7 +55,6 @@ public:
|
|||||||
* 0 : Device Scanning is already running in within this program.
|
* 0 : Device Scanning is already running in within this program.
|
||||||
* 1 : Successfully started up DeviceScanning from the current program.
|
* 1 : Successfully started up DeviceScanning from the current program.
|
||||||
*/
|
*/
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect")
|
|
||||||
static int32 Init();
|
static int32 Init();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,12 +68,10 @@ public:
|
|||||||
* 1 : Successfully disposed of DeviceScanner resources.
|
* 1 : Successfully disposed of DeviceScanner resources.
|
||||||
* @remark If the Dispose function returns 1, the resources were neatly disposed of. Only a value of -3 is cause for concern.
|
* @remark If the Dispose function returns 1, the resources were neatly disposed of. Only a value of -3 is cause for concern.
|
||||||
*/
|
*/
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect")
|
|
||||||
static int32 Dispose();
|
static int32 Dispose();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check which version of SGConnect you are using.
|
* Check which version of SGConnect you are using.
|
||||||
*/
|
*/
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect")
|
|
||||||
static FString GetLibraryVersion();
|
static FString GetLibraryVersion();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* (The MIT License)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020 - 2022 SenseGlove
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "SGConnectKismet/SGConnectKismetLibrary.h"
|
||||||
|
|
||||||
|
#include "SGConnect/SGConnect.h"
|
||||||
|
|
||||||
|
int32 USGConnectKismetLibrary::Init()
|
||||||
|
{
|
||||||
|
return FSGConnect::Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
int32 USGConnectKismetLibrary::Dispose()
|
||||||
|
{
|
||||||
|
return FSGConnect::Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
FString USGConnectKismetLibrary::GetLibraryVersion()
|
||||||
|
{
|
||||||
|
return FSGConnect::GetLibraryVersion();
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* (The MIT License)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020 - 2022 SenseGlove
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Containers/Array.h"
|
||||||
|
#include "HAL/Platform.h"
|
||||||
|
|
||||||
|
#include "SGKismet/SGBlueprintFunctionLibrary.h"
|
||||||
|
|
||||||
|
#include "SGConnectKismetLibrary.generated.h"
|
||||||
|
|
||||||
|
UCLASS(meta=(ScriptName = "SesneGloveConnectKismetLibrary"))
|
||||||
|
class SENSEGLOVECONNECTKISMET_API USGConnectKismetLibrary final : public USGBlueprintFunctionLibrary
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Begin Scanning for Sense Glove Devices and set up communications with them.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* -3 : An Unexpected error occured. Please try again.
|
||||||
|
* -2 : Device Scanning is already running within a different program.
|
||||||
|
* -1 : Device Scanning already being initialized (function called twice in short succession).
|
||||||
|
* 0 : Device Scanning is already running in within this program.
|
||||||
|
* 1 : Successfully started up DeviceScanning from the current program.
|
||||||
|
*/
|
||||||
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect")
|
||||||
|
static int32 Init();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispose of unmanaged resources and finalize Sense Glove devices.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* -3 : An Unexpected error occured. Please try again.
|
||||||
|
* -2 : Not allowed to dispose of Device Scanning because this is not the program which started it.
|
||||||
|
* -1 : Device Scanning is currently being disposed off. This takes a second or two. (function called twice in short succession).
|
||||||
|
* 0 : There is no deviceScanner running from any program, so disposing is skipped.
|
||||||
|
* 1 : Successfully disposed of DeviceScanner resources.
|
||||||
|
* @remark If the Dispose function returns 1, the resources were neatly disposed of. Only a value of -3 is cause for concern.
|
||||||
|
*/
|
||||||
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect")
|
||||||
|
static int32 Dispose();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check which version of SGConnect you are using.
|
||||||
|
*/
|
||||||
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect")
|
||||||
|
static FString GetLibraryVersion();
|
||||||
|
};
|
||||||
@@ -55,16 +55,10 @@ public class SenseGloveConnectKismet : ModuleRules
|
|||||||
"CoreUObject",
|
"CoreUObject",
|
||||||
"Engine",
|
"Engine",
|
||||||
"SenseGloveConnect",
|
"SenseGloveConnect",
|
||||||
|
"SenseGloveKismet",
|
||||||
"SenseGloveLog",
|
"SenseGloveLog",
|
||||||
"SenseGloveTypes",
|
"SenseGloveTypes",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
PrivateIncludePathModuleNames.AddRange(
|
|
||||||
new string[]
|
|
||||||
{
|
|
||||||
"SenseGloveKismet",
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,4 +62,4 @@ public class SenseGloveCoreKismet : ModuleRules
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user