Re: Possible Orx Game Engine Wrapper
- Posted by Icy_Viking Jul 20, 2021
- 1041 views
Hello all,
I recently came across this game engine. Its called Orx. Its written in C, but can be used with CPlusplus. It has a portable architecture. I was wondering if I could get some feedback on how feasible it would be to make a wrapper in Eu for this game engine? I glanced over some code and it doesn't look like it would be too difficult, but I'd like to hear what others think.
Two major hurdles I'm seeing here:
- Calling convention: Most of the library functions are declared using the fastcall convention, which Euphoria isn't currently built to handle (we only support stdcall and cdecl). It's possible this might only be the case when compiling the library statically so that it's embedded into the resulting executable and the shared library might still be using stdcall or cdecl. I haven't dug through the code enough to tell yet. The good news is that all those different conventions only affect x86 and on x64 there's just "the x64 calling convention" so it should work fine if you stick to 64-bit Euphoria (which you should!).
- Inline functions: Some functions of the library are declared inline which means they're always compiled directly into the executable and don't get exported (or even compiled into) the shared library. You could either unmark these as inline and rebuild the library or reconstruct them directly in Euphoria. Unfortunately the orx_Execute function is marked inline, and it's literally the first function you need to bootstrap a program.
-Greg
Thanks for your input Greg. It looks like wrapping that exexcute function might take a little bit of work. I might attempt to make a wrapper for this. I wish there was more game engines written in C.
EDIT: I notice that Orx_Debug is exported in the DLL. That function is called in Orx_Execute. However Orx_Execute is not exported as its an inline function as you've mentioned. Orx_Debug is the first function called inside of Orx_Execute.