Aurel300/ammer

is that possible overload in c++ warp API to hl?

sonygod opened this issue · 3 comments

image

is that possible overload in c++ warp API to hl?

maybe this feature depends on Haxe 4.1. so I'm close this and will reopen when Haxe 4.1 is finished.

I'm going to reopen this to make sure I don't forget. Overload syntax is currently only available in externs, which is not the way I handle the actual class that extends ammer.Library at the moment. However, it should still be possible to call external APIs that have overloads. This is related to #13 in that C++ linkage needs more work in general. Also both this issue and #13 require that ammer supports instances of C++ classes, which is currently not the case.

Maybe the syntax will be something like:

@:ammer.overloads("CardGroup") @:ammer.constructor
public static function construct1():CardGroup;
@:ammer.overloads("CardGroup") @:ammer.constructor
public static function construct2(t:Int, v:Int):CardGroup;

Suggestions welcome.

I'm not sure about Haxe-side overloads, but you should now be able to do:

@:ammer.native("CardGroup") @:ammer.cpp.constructor
public static function construct1():CardGroup;
@:ammer.native("CardGroup") @:ammer.cpp.constructor
public static function construct2(t:Int, v:Int):CardGroup;