• Advertisement
Sign in to follow this  

who can give ma an example how to use SetArgAddress?

This topic is 3650 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Knights: I can not understand the useful of SetArgAddress , who can give me an example? In C++ and In AS

Share this post


Link to post
Share on other sites
Advertisement
Here's an example:


// Script
void Test(float &out outValue)
{
outValue = 3.141592f;
}



// C++
int funcId = engine->GetFunctionIdByDecl(0, "void Test(float &out)");
asIScriptContext *ctx = engine->CreateContext();
ctx->Prepare(funcId);
float value;
ctx->SetArgAddress(0, &value);
ctx->Execute();
assert( value == 3.141592f );
ctx->Release();


Regards,
Andreas

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement