🎉 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!

Overloaded functions

Started by
1 comment, last by DaesDemon 18 years, 9 months ago
Hello friends, Just a little declaration Question: I am pretty sure i have seen the answer somewhere but can find it back. I have a class with an overloaded method: removeCamera(string) removeCamera(camera*) How can i register one of this method with ASMETHOD:
Quote: Engine->RegisterObjectMethod("SceneManager","void removeCamera(const string ∈ name)",asMETHOD(SceneManager,removeCamera),asCALL_THISCALL);
obviously don't compile as compiler don't know which function i want to target.
Advertisement
Use the asMETHODPR() macro, that takes the parameter list and return type as well.

Example:

Engine->RegisterObjectMethod("SceneManager","void removeCamera(const string ∈ name)",asMETHODPR(SceneManager,removeCamera,(camera*),void),asCALL_THISCALL);

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

Thanks you ;)

This topic is closed to new replies.

Advertisement