Hacker News new | ask | show | jobs
by mdmglr 1368 days ago
I’m not a game developer. What I would like to know is how does porting the code that draws the UIs and perhaps the game work? For example on PC one might use WinForms and DirectX so is this just a matter of writing wrappers to all your DirectX calls to the Switch equivalents?
2 comments

Factorio uses SDL. Factorio has been cross-platform (Linux, Windows, Mac) from the beginning, so it makes sense that they're not tied down to Microsoft's proprietary nonsense. I'd imagine this choice made it a lot easier to port to the Switch as well.

https://www.factorio.com/blog/post/fff-230

https://www.libsdl.org/index.php

It is a bit more involved than that, but yeah that is kind of basics.

The Switch supports OpenGL 4.6, Vulkan, and their own API NVN, which actually many engines make use of. Most likely Factorio is using one of the former anyway, so that problem is kind of out of the way, other that having to deal with the extensions and hardware/driver specific behaviors.

Then as they mention the blog, having to adjust the way the GUI works from a PC setup to an handheld.