🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

who can give ma an example how to use SetArgAddress?

Started by
1 comment, last by yzslhawk 16 years, 4 months ago
Knights: I can not understand the useful of SetArgAddress , who can give me an example? In C++ and In AS
Advertisement
Here's an example:

// Scriptvoid 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

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

thank you very much!

This topic is closed to new replies.

Advertisement