Hello,
I'm trying to port my application from IBM APL2 to J and have the following
question:
how can I call a DLL function having a pointer to a structure as an argument
(or as an result)?
For example:
bool AdvancedCollision(VECTOR3D* pStart, VECTOR3D* pEnd, COLLISIONRESULT*
retResult);
where VECTOR3D is:
typedef struct {
float x;
float y;
float z;
} VECTOR3D;
and COLLISIONRESULT is:
typedef struct {
VECTOR3D vCollisionNormal;
VECTOR3D vCollisionImpact;
float fDistance;
float fU;
float fV;
int iFaceindex;
int iGroupIndex;
bool bHasCollided;
int iEntityID;
int iMeshID;
int iLandscapeID;
int iBoneID;
float fTexU;
float fTexV;
} COLLISIONRESULT;
Should I create the structures using mema/memw first and then pass the
pointers? Is there a straight way?
AdvancedCollision function writes the new values for COLLISIONRESULT. Again,
should I use memr to read the contents of COLLISIONRESULT or there is a way
to get a nested array right away?
APL2 allows to specify a pointer to a structure directly (I use QuadNA).
Thank you in advance,
Mik.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm