Somebody can help me to transform this code to Delphi:
typedef struct IUnityInterfaces
{
// Returns an interface matching the guid.
// Returns nullptr if the given interface is unavailable in the active Unity runtime.
IUnityInterface* (UNITY_INTERFACE_API * GetInterface)(UnityInterfaceGUID guid);
// Registers a new interface.
void (UNITY_INTERFACE_API * RegisterInterface)(UnityInterfaceGUID guid, IUnityInterface* ptr);
#ifdef __cplusplus
// Helper for GetInterface.
template <typename INTERFACE>
INTERFACE* Get()
{
return static_cast<INTERFACE*>(GetInterface(GetUnityInterfaceGUID<INTERFACE>()));
}
// Helper for RegisterInterface.
template <typename INTERFACE>
void Register(IUnityInterface* ptr)
{
RegisterInterface(GetUnityInterfaceGUID<INTERFACE>(), ptr);
}
#endif
} IUnityInterfaces;
/////////////////////////////////////////////////////////////////////////////////////
I try to transform like this:
type
PUnityInterfaces = ^TUnityInterfaces;
TUnityInterfaces = Object //clase(TInterfacedObject)
public
UnityInterface: IUNkNOWN;
//queryInterface
//RegisterInterface
function Get(Guid:TGUID):IUnityGraphics;
procedure Register(Guid:TGuid;_inf Pointer);
end;
then i load Func :
procedure UnityPluginLoad(unityInterfaces: PUnityInterfaces); stdcall
always addr error!
Why???