mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 23:36:00 +02:00
Store prodName/guid
This commit is contained in:
parent
4322c984cc
commit
202a3f7cfc
1 changed files with 5 additions and 1 deletions
|
@ -10,6 +10,8 @@ namespace Beefy.input
|
||||||
[CallingConvention(.Stdcall), CLink]
|
[CallingConvention(.Stdcall), CLink]
|
||||||
public static extern char8* BFInput_GetState(void* nativeInputDevice);
|
public static extern char8* BFInput_GetState(void* nativeInputDevice);
|
||||||
|
|
||||||
|
public String mProdName ~ delete _;
|
||||||
|
public String mGUID ~ delete _;
|
||||||
void* mNativeInputDevice;
|
void* mNativeInputDevice;
|
||||||
|
|
||||||
public ~this()
|
public ~this()
|
||||||
|
@ -36,12 +38,14 @@ namespace Beefy.input
|
||||||
outData.Append(BFApp_EnumerateInputDevices());
|
outData.Append(BFApp_EnumerateInputDevices());
|
||||||
}
|
}
|
||||||
|
|
||||||
public InputDevice CreateInputDevice(StringView guid)
|
public InputDevice CreateInputDevice(StringView prodName, StringView guid)
|
||||||
{
|
{
|
||||||
void* nativeInputDevice = BFApp_CreateInputDevice(guid.ToScopeCStr!());
|
void* nativeInputDevice = BFApp_CreateInputDevice(guid.ToScopeCStr!());
|
||||||
if (nativeInputDevice == null)
|
if (nativeInputDevice == null)
|
||||||
return null;
|
return null;
|
||||||
InputDevice inputDevice = new .();
|
InputDevice inputDevice = new .();
|
||||||
|
inputDevice.mProdName = new String(prodName);
|
||||||
|
inputDevice.mGUID = new String(guid);
|
||||||
inputDevice.[Friend]mNativeInputDevice = nativeInputDevice;
|
inputDevice.[Friend]mNativeInputDevice = nativeInputDevice;
|
||||||
return inputDevice;
|
return inputDevice;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue