Merry Christmas everyone! Honestly Christmas is not so important for me but it may be very important for you guys:) Also wish everyone of you a Happy New Year!
Here's the point: suppose we have a Ruby object, which represents the
document object in DOM. We can use
method_missing.function_name to get this function. Problem solved.
Did you see my mistake? What I miss here is that getting the function is only one side of the stories. We still have all the arguments to process. At mruby side we have
mrb_value that tells us the type of the argument, but when passing through the C layer, we need to resolve to the
I could build a
mrb_value-like type to use in
Maybe my original plan on an OpenGL ES 2.0 API is right-_- Anyway, I will update here if I have more results.
Update: Well, I manage to succeed in building an interface using neither of the methods above! I just pass the pointer(array) of values to the JS side, and then let the JS code call "back" to the C code to process the arguments one-by-one. The cost should not be more than simply looping through the arguments. The internal structure of mruby calling stack helps a lot in this implementation! If you are interested, feel free to check out the code, specifically this commit.