views:

85

answers:

3

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

+5  A: 

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

Mehrdad Afshari
A: 

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.

ChrisF
You could alternatively have devs ship sources and invoke the compiler on the user's system, but that doesn't work well on Windows unless you ship GCC with the app.
Michael E
+2  A: 

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.

Michael E