Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualAndreas Jonsson

Posted 08 October 2012 - 06:56 AM

The <unresolved overloaded function type> is most likely because SFML implements the equality operator as a class method instead of a global function. Try changing the registration to the following:

r = engine->RegisterObjectMethod("string", "bool opEquals(const string &in) const", asMETHODPR(sf::String, operator ==, (const sf::String &) const, bool), asCALL_THISCALL); assert( r >= 0 );

Hopefully it should work. If not, please post what the SFML string class looks like.

The string type is really just an ordinary type in AngelScript, and is registered just like that with the only exception being the additional string factory. I include registration for the std::string because it is the most common, but many developers use their own implementation.



std::basic_string<Uint32> is a completely different type than std::basic_string<char>, a.k.a std::string, so the fact that both are implemented from the same template doesn't really make things any easier here.

#1Andreas Jonsson

Posted 08 October 2012 - 06:55 AM

The <unresolved overloaded function type> is most likely because SFML implements the equality operator as a class method instead of a global function. Try changing the registration to the following:

r = engine->RegisterObjectMethod("string", "bool opEquals(const string &in) const", asMETHODPR(operator ==, (const sf::String &) const, bool), asCALL_THISCALL); assert( r >= 0 );

Hopefully it should work. If not, please post what the SFML string class looks like.

The string type is really just an ordinary type in AngelScript, and is registered just like that with the only exception being the additional string factory. I include registration for the std::string because it is the most common, but many developers use their own implementation.



std::basic_string<Uint32> is a completely different type than std::basic_string<char>, a.k.a std::string, so the fact that both are implemented from the same template doesn't really make things any easier here.

PARTNERS