Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sonygod opened this issue Aug 21, 2019 · 3 comments
Open

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

sonygod opened this issue Aug 21, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@sonygod
Copy link

sonygod commented Aug 21, 2019

image

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

@sonygod sonygod changed the title is that possible overrload in c++ warp to hl? is that possible overload in c++ warp API to hl? Aug 21, 2019
@sonygod
Copy link
Author

sonygod commented Aug 21, 2019

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

@sonygod sonygod closed this as completed Aug 21, 2019
@Aurel300 Aurel300 added the enhancement New feature or request label Aug 21, 2019
@Aurel300
Copy link
Owner

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.

@Aurel300 Aurel300 reopened this Aug 21, 2019
@Aurel300
Copy link
Owner

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants