开发者

Plugin System without rebuilding for each OS?

开发者 https://www.devze.com 2023-01-17 19:52 出处:网络
I\'m making a game that will allow content development and I\'d like it to be sort of a DLL based system. But, my game works for Linux (X86 arch) , Mac OSX and 32 bit Windows. Is there a way I could a

I'm making a game that will allow content development and I'd like it to be sort of a DLL based system. But, my game works for Linux (X86 arch) , Mac OSX and 32 bit Windows. Is there a way I could allow content developers to compile only one thing and have it work based开发者_开发百科 on the platform? I fear it might get confusing if there are 3 versions per plugin. What could I do?

Thanks


You can decide to use a cross-platform scripting environment like Lua for plugins. This is essentially what most cross-platform games do.


You could possibly use LLVM as a middle ground if you want C or C++ plugins. Have plugin devs ship LLVM assembly/bytecode, and use LLVM's runtime code emission to compile it to native code when you load it.


Unless things have changed drastically since I last looked at cross platform development if you are using c/c++ you need to compile and link for the operating system you are going to execute on.

So if you want to run on 3 operating systems you need 3 binaries.


weren't e.g. Xfree86 and/or Xorg drivers (video? or something else?)

"cross-OS" so they could be built once and "run" on any OS, at least on the same CPU....

no idea how that works ... a virtual machine of some kind perhaps???

probably overkill ...but certainly possible.....

0

精彩评论

暂无评论...
验证码 换一张
取 消