i register it so; r = engine->RegisterObjectMethod("ManualObject", "void begin(const string &in, int renderop)", asMETHOD(ManualObject, begin), asCALL_THISCALL);
assert( r >= 0);
call it with
manual.begin("lootray", OT_LINE_STRIP);
causes this assertion:
Run-Time Check Failure #2 - Stack around the variable 'retQW' was corrupted
this function works, if i register the whole thing void begin(const string &in, int renderop, const string &in)
i think i do the registeration wrong.
How do i register functions with default parameters?
Default parameters are entirely a compiler thing-- they're just instructions to the compiler to add some behind-the-scenes code if you don't manually specify arguments when the function is called. Due to how Angelscript works, you can't take advantage of this since it doesn't call functions the 'normal' way. You'll need to actually add the default arguments to the AS declaration instead of just assuming the compiler will handle it.
EDIT: For clarity, I refer specifically to the "void begin(const string &in, int renderop, const string &in)" bit.
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.
Default parameters are entirely a compiler thing-- they're just instructions to the compiler to add some behind-the-scenes code if you don't manually specify arguments when the function is called. Due to how Angelscript works, you can't take advantage of this since it doesn't call functions the 'normal' way. You'll need to actually add the default arguments to the AS declaration instead of just assuming the compiler will handle it.
EDIT: For clarity, I refer specifically to the "void begin(const string &in, int renderop, const string &in)" bit.
i didnt know angelscript supports default values in declearations.
another awesome feature i missed.