TheStolenBattenberg
Member
I have a slight feeling that this function doesn't do the awesome things I wanted it too.
If I'm correct, it should return the memory address of a variable that I choose, but I can't seem to get it to work right. Does it not work with the VM compile, or is the function fake? If all it does is convert to hex, I'd presume naming it 'hex' would be better, not ptr.
I'm sending the returned values to a DLL, hoping I'd be able to make some really nice improvements to MAEngine. I'm doing this, but I'm not sure if it's right, since all I'm getting is hexadecimal versions of the same number, not a memory address.
This is how I'm sending.
This is how I'm receiving.
These are what GM is saying the memory addresses are:
Any ideas? Being able to manage memory in C++ could be groundbreaking for extensions.
If I'm correct, it should return the memory address of a variable that I choose, but I can't seem to get it to work right. Does it not work with the VM compile, or is the function fake? If all it does is convert to hex, I'd presume naming it 'hex' would be better, not ptr.
I'm sending the returned values to a DLL, hoping I'd be able to make some really nice improvements to MAEngine. I'm doing this, but I'm not sure if it's right, since all I'm getting is hexadecimal versions of the same number, not a memory address.
This is how I'm sending.
Code:
///GML
///GMLEObjectHook();
gml_pragma("forceinline");
//Hook Coordinates
external_call(GMLEController.FUNC[0], ptr(x), ptr(y), ptr(z));
Code:
///DLL / C++
GMEXPORT double ObjectHook(double* x, double* y, double* z) {
obj = new CObject(x, y, z);
std::cout << x << std::endl;
std::cout << y << std::endl;
std::cout << z << std::endl;
return 1;
}
I started with an X of 512, Y of 256 and a Z of 4, which is the equivalent of those in decimal.00000200
00000100
00000004
Any ideas? Being able to manage memory in C++ could be groundbreaking for extensions.