Commit graph

21 commits

Author SHA1 Message Date
05298b6111 Add support for object parameters to Wren calls 2024-05-25 01:47:51 +02:00
72da0b8d87 Fix build when std::string is a lone parameter
The "any tuple-like" thing was nice but
it was confusing when passing for example
a std::string, which is a typedef to a
tuple-like thing. Making a custom
ConstructorParameters struct is more clear
both to users and to the compiler.
2024-05-24 17:12:04 +02:00
742271ad09 Get rid of the iostream include in bt::string 2022-05-24 16:38:34 +02:00
addb48822f Refactor so that make_method_bindable also accepts free functions now 2022-05-19 19:22:20 +02:00
1fa6d62f17 Add support for registering foreign methods that return foreign objects
Still a bit work in progress but functioning
2022-05-18 18:48:18 +02:00
eadd25b827 Foreign function callbacks now receive a ModuleAndName parameter too.
This commit breaks the ARM64 version, I will fix it next.

Lots going on here. DynafuncMaker got updated to store strings
to back the ModuleAndName objects that get hardcoded in the
assembly glue function.
ModuleAndName is not a typedef to a tuple anymore, because I
discovered that tuples suck. They get always pushed on the stack
when passed as parameter, instead the new implementation gets
passed into 2 registers being it a standard layout type.

dhandy::bt::string got updated so it can be used as a literal
value for non-type template parameters, which allowed for a
really easy to use `wren::MN<>` helper. Code now fully requires
c++20.
2022-05-17 01:06:36 +02:00
816a8af654 Fix memory leak, improve code 2022-05-15 20:17:42 +02:00
692393285d Fix memory leaks 2022-05-15 19:19:56 +02:00
4d3dfce93f Improve and cleanup make_foreign_class()
No need to have two versions of this.
Static assert when users specify ambiguous overloads.
Currently overloads are discriminated only by
parameter count, not types, so we need to enforce this.
2022-05-15 17:01:57 +02:00
b8066a3f34 Add working example of constructor overloading 2022-05-15 16:03:29 +02:00
258237cbf3 Implement ClassManager
Very similar to CallbackManager in its functioning.
2022-05-14 17:06:25 +02:00
c2089568f3 Bugfixes and improvements, simplify examples 2022-04-29 18:35:46 +02:00
fa0183a3bf Implement CallbackManager
With it users don't have to provide a foreign_method_fn()
function anymore, it's become optional.
2022-04-29 18:16:57 +02:00
31ba3af348 Update copyright year 2022-04-28 22:56:11 +02:00
6f4b0ce094 Pass string_view instead of const char* to callback functions 2022-04-28 22:55:22 +02:00
dfb3514ffc Fix variable names and split long line 2022-04-22 10:36:25 +02:00
6a30725a62 Add arbitrary method to foreign_method_t conversion helper
It might not work in every case, you still are restricted
to types that set() and get() understand.
2020-05-03 12:23:06 +02:00
34d2317f11 Add support for foreign types to get()
wren::get() can now be used to get foreign types by pointer.
Invoking get<A>() will return an A*. With this change it's
now possible to use variables() to get mixed foreign
and core types.
2020-05-03 11:32:43 +02:00
90d93d2583 Add calendar example and supporting functions 2020-05-03 01:54:07 +02:00
65189a5575 Move files around
Sample main.cpp is now into examples/greet
2020-05-02 22:55:10 +02:00
a3c1199da9 Add a small dice rolling example game 2020-05-02 22:41:58 +02:00