how do I fill and pass a c struct to a dll from max
in c:
typedef struct dsFunctions {
Int version; /* put DS_VERSION here */
/* version 1 data */
void (*start)(); /* called before sim loop starts */
void (*doStep) (Int pause); /* called before every frame */
void (*command) (Int cmd); /* called If a command key is pressed */
void (*stop)(); /* called after sim loop exits */
/* version 2 data */
char *path_to_textures; /* If nonzero, path To texture files */
max:
extern
Function dsSimulationLoop(argc:Int,argv:BytePtr,window_width:Int,window_height:Int,dsFunctions:Byte Ptr)
end extern
filling up a type and sending a pointer to it doesnt seem to work, the dll function
runs but doesnt get the right version number
typedef dsFunct
field ver:int
field start_p:var ptr
..
..
enddef
dsf:dsFunctions=New dsFunctions
dsf.ver=2
..
..
dsSimulationLoop (0,Null,352,288,Varptr dsf)
in c:
typedef struct dsFunctions {
Int version; /* put DS_VERSION here */
/* version 1 data */
void (*start)(); /* called before sim loop starts */
void (*doStep) (Int pause); /* called before every frame */
void (*command) (Int cmd); /* called If a command key is pressed */
void (*stop)(); /* called after sim loop exits */
/* version 2 data */
char *path_to_textures; /* If nonzero, path To texture files */
max:
extern
Function dsSimulationLoop(argc:Int,argv:BytePtr,window_width:Int,window_height:Int,dsFunctions:Byte Ptr)
end extern
filling up a type and sending a pointer to it doesnt seem to work, the dll function
runs but doesnt get the right version number
typedef dsFunct
field ver:int
field start_p:var ptr
..
..
enddef
dsf:dsFunctions=New dsFunctions
dsf.ver=2
..
..
dsSimulationLoop (0,Null,352,288,Varptr dsf)