01-17-2017, 04:00 PM
(01-14-2017, 05:01 AM)sphinxc0re Wrote: Sounds like a good project. I guess it is totally possible to write bindings for any other language.
Thanks.
What I'm looking for is to be able to compile cuberite as a C++ library that I could dynamically load it into my system using dlopen. From Common Lisp I could then create cuberite C++ classes and call cuberite functions to set things up. Then I would create a main loop and call a cuberite function to step the world forward one time step. Since Clasp generates compiled native code using LLVM the main loop could include a lot of Common Lisp code to drive the game.
Here's a demo I put together yesterday where I expose a small part of the Bullet physics engine and set up and run a little simulation.
https://github.com/drmeister/demo-bullet
I'd like to do something like that with cuberite. It would be a great teaching tool for kids because they could load up the system and then start modifying the behavior of animals and writing code to build structures within the world.
I can deal with the bindings - that's my forte. Clasp has a C++ template library that semi-automatically creates bindings. It also exposes the Clang C++ compiler front end so I have access to the C++ AST from Common Lisp. I can slurp up the cuberite C++ API and automatically create bindings.
I think "libcuberite" is what I'm looking for. I'm thinking to take out the main function and link everything as a library.