Monday, February 12, 2018

how to write a game in c++ from scratch

Disclaimer: I am in no way a game developer, this is the story of my tries and errors.

So, we decided to create a project to exercise c++17. Let it be a game. It has been decided to use cmake and gtest and tdd. Perfect. And then we realized we have no idea how to build an architecture for a game. Googled it. Found this outdated tutorial:

http://www.gamefromscratch.com/page/Game-From-Scratch-CPP-Edition-Part-2.aspx

Well, at least the author provided some basic architecture we can use. So, let's write a ping-pong game!

The tutorial is easy and I thought I could have it running in a day. But alas! 3 days in we are stuck with environment configuration.

This is how it goes: we use sfml as our graphics lib. At first I wanted to use cmake to fetch the master from github, build and link it, just as it is done in the gtest how-to. But, it has around 10 dependecies. We cannot rely on the developer to install all of them by hand, right? Right? So, it has been decided to pre-build sfml statically. Does it mean that I will have to build all 10 deps statically too? And what if each of them has 10 dependencies? omg.