Sign in to follow this  
yzslhawk

who can give ma an example how to use SetArgAddress?

Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this