I am doing a bit of research before I am going to write my own 2D (and maybe some 3D) game engine. I have made an engine before using C# and XNA but I want to go cross platform this time by making my new engine in C++ using opengl etc.
But … I still want the fast iteration times from C# and have access to the game engine there.
So I have a few options here.
- Write the engine and a CLI wrapper in C++
- Write the whole thing directly in C#, no C++
- Write in C++ and use Mono to load C# Code / Assemblies into the engine.
- No C#
- … Probably something I didnt think of yet
I think I do need the speed for culling, scenegraph stuff, Matrix calculations, particle systems etc.
Wat are the Pros and Cons?
What do you suggest?
If you want cross platform, you can’t use C++/CLI. This isn’t supported on any platforms other than Windows.
That being said, for cross platform, I’d either use C# with Tao, or use C++ to make the engine a library, and the use Platform Invoke to “use” the library from within your C# code. This will provide you the speed and control you need in the core engine (C++), with the flexibility of game design in C#.
This provides a clean, cross platform means of developing a game engine that can be exposed to C#.