Jump to content
  • Advertisement

miki151

Member
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

108 Neutral

About miki151

  • Rank
    Newbie
  1. miki151

    Add-ons license

    I'd like to include some of the add-ons (scriptbuilder, scripthelper, scriptstdstring) into the source distribution of my project. These files don't have any license included, am I correct that it's the same license as the library? Or is there perpahs a way to statically link the add-ons together with the library?
  2. I prefer to use value types, but it seems the list factory function can only create reference types. Is there a way to create value types with initialization list, or perhaps register a function with a variable number of arguments of the same type using the generic calling convention?   Basically, all I want is a very simple container that gets passed back to C++ by value.
  3. miki151

    Registering a std::function

    I'm not sure how I could do that. These functions would need to be stored somewhere during the life of the engine.
  4. miki151

    Registering a std::function

    Ok, got it. engine->RegisterGlobalFunction("void print(S1)", asMETHOD(decltype(printFun), operator()), asCALL_THISCALL_ASGLOBAL, &printFun) EDIT: it would be useful if one could register the std::function by passing it by value, not by pointer. Right now the function needs to be declared in the same scope as the engine, which kind of defeats the purpose of lambdas.
  5. miki151

    Registering a std::function

    Hello,   Complete AngelScript newbie here. I'm in need of emulating a global function with a std::function. I noticed a brief mention of this in the docs, but couldn't find any example.   Here's what I tried: function<void(S1)> printFun = [] (S1 s) { print(s);} ; engine->RegisterGlobalFunction("void print(S1)", asFUNCTION(printFun), asCALL_THISCALL_ASGLOBAL); And the error was: (0,0) : ERROR: Failed in call to function 'RegisterGlobalFunction' with 'void print(S1)' (Code: -24)  
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!