Work around some issues which prevented Mittsu from running on any version of JRuby.
Fiddle does not automatically convert function arguments to pointers unless they have a to_ptr method. Fiddle::Closure does not have a to_ptr method, and therefore cannot be passed as an argument (e.g. GLFW callbacks). Manually converting them to a pointer works around this issue.
Similarly, Ruby integers do not have a to_ptr method, And must therefore be manually converted to pointers before being passed as function arguments.
nil, however, is automatically converted to a nullptr in JRuby (and thus works as a suitable substitute for 0)
TODO:
[x] Get blank scene example running in JRuby
[x] Get geometry examples running in JRuby
[ ] Some of the more complex examples (e.g. torus knot example) quit with no output
[ ] The tests also quit with a non-zero exit code with no output (possibly same issue as above)
[ ] Add JRuby to github action test matrix
[ ] print_tree just prints question marks instead of the special drawing chars (could be an encoding issue? could be a windows-only issue?)
Work around some issues which prevented Mittsu from running on any version of JRuby.
to_ptr
method.Fiddle::Closure
does not have ato_ptr
method, and therefore cannot be passed as an argument (e.g. GLFW callbacks). Manually converting them to a pointer works around this issue.to_ptr
method, And must therefore be manually converted to pointers before being passed as function arguments.nil
, however, is automatically converted to a nullptr in JRuby (and thus works as a suitable substitute for0
)TODO:
print_tree
just prints question marks instead of the special drawing chars (could be an encoding issue? could be a windows-only issue?)