3 ms·
“even those that use C# do it this way” The only thing we do is P/Invoke native draw calls. OpenGL, DirectX, Vulkan, they expose C functions that we call with
by reactordev 3y ago
“even those that use C# do it this way”
The only thing we do is P/Invoke native draw calls. OpenGL, DirectX, Vulkan, they expose C functions that we call with pinned memory. That’s about where it stops. Everything else is in C#. Events, actions, game logic, networking, file system, all in C#.
- lewispollard 3y agoWho's "we" in this case?
- reactordev 3y agoAuthors of C# game engines
- lewispollard 3y agoI can think of MonoGame and Stride as examples/exceptions, though I suppose there are more out there, including peoples' own engines. Most popular engines that expose a C# interface officially or unofficially take the other route. But I grant you that the oft-given reason for this - performance - isn't impossible to achieve with pure C#, it just takes a lot more skill and knowledge, and that performance via native calls to a C++ engine aren't always more performant anyway due to marshalling.