The first thing when developing a graphics application is to open a blank window.
Creating a header file
In this tutorial, we will create a new header file src/window.hpp that is responsible for interfacing and abstracting the windowing library of our choice GLFW.
Next, we need to include the libraries. Since we need the native window handle later, we also need the native GLFW headers. Since those libraries are platform dependant though, we need some extra preprocessor magic.
We now need to add some properties to our window struct. This includes the GLFW window pointer, the current width and height, whether the window is minimized and whether the swapchain is out of date due to the resizing of the window.
We can now create a constructor and a destructor for the window.
Next, we need to create functions to obtain the native handle of the window and the platform identifier.
While we are at it, we can also create some utility functions.
Opening our window
We can now go ahead and open our window for the first time. We therefore need to extend our main.cpp file.