Again reminding the OP: Use Ctypes for the bindings!
You might get lucky that the native Pascal-Types are correct for your intended Target, another User trying to use it for a different target might start a nuclear rocket in North Korea
Note that one should use the ctypes unit together with the types that it declares to convert C headers instead of trying to use the basic Pascal types directly. This ensures that the bindings are correct in all platforms, as the C types might have different sizes on different architectures and operating systems.
Very interesting. :)
I could compile and run successfully the C demo (with the static lib, on Linux Mageia). Very nice! (By the way, it was very easy to install raylib.)
For the Pascal demo, I have to find how to build libtyphoon.so.
Could you share the binary, or explain how you built it?
https://wiki.freepascal.org/Creating_bindings_for_C_libraries#Manual_conversion_of_C_headers_to_PascalQuoteNote that one should use the ctypes unit together with the types that it declares to convert C headers instead of trying to use the basic Pascal types directly. This ensures that the bindings are correct in all platforms, as the C types might have different sizes on different architectures and operating systems.
@funlw65
Thanks. I will try to do that.
There is tytest.pas in the repository, but only for a few functions and I thought I would make something similar to MushRoomsDatabase by Jurassic Pork, but for fpc only, using raylib/raygui as an alternative to the classic GUI interfaces.
There is tytest.pas in the repository, but only for a few functions and I thought I would make something similar to MushRoomsDatabase by Jurassic Pork, but for fpc only, using raylib/raygui as an alternative to the classic GUI interfaces.
Following your instructions I could compile libtyphoon.so and tytest.pas. The program works well here.
Thanks for the manual.