Pass dll function arguments by reference in gamemaker?

Samuel Venable

Time Killer
Does GameMaker support passing dll function argument pointers by reference? How is this done? In c++ I simply use an "&" in front of an uninitiated or nullptr-equaling variable.
 
Last edited:

EvanSki

Raccoon Jam Host
Im not exactly sure, but I do know
  • if the dll is meant to return a value and it doesnt, game maker will use a 0
  • if game maker sends an argument to the dll and the dll doesnt take arguments, the dll ignores it (it might store it in memory, idk but from my testing it kind of gets lost in space)
 

Tthecreator

Your Creator!
Well passing by reference is underwater just like passing by pointer. The difference in C++ is that when passing something by reference you are guaranteed that that pointer points to valid memory. This is done by requiring that a reference is created from an actual C++ object variable and not a pointer variable.

This paradigm is something that is hard to make operable between multiple languages. You are probably better of just passing a pointer (which you can get in GM) and then doing checks on it to make sure it is valid.
 
Top