A modular window class (Part 1)

While I was preparing C++ code for tutorials eventually leading to different form of collision detection the very basic problem of creating and displaying a simple window occurred. I haven’t completely solved it yet but I’d like to share some intermediate insights.

It was certainly not the first time of me thinking about a window system and of course many different libraries exist that already solve the problem. Nonetheless I wanted to do it by myself mostly out of two reasons:

  1. I want to keep the dependencies for the tutorial code as low as possible, and
  2. I find it quite instructional to solve the problem from scratch.

To make things more complicated I wanted the solution to be reusable, modular and cross platform, each in the best spirit of C++. I opted to only use Xlib and Win32 as base libraries for my window system. Read more about the consequences of these decisions in the next part of this series.