1
Creating the Game Window
This is the start of your journey into the world of game character animation programming. In this book, you will open a window into a virtual world, enabling the user to take control and move around in it. The window will utilize hardware-accelerated graphics rendering to show detailed characters that have been loaded from a simple file on your system. You will be introduced to character animation, starting with basic steps such as how to show a single, static pose, and you will move on to more advanced topics such as Inverse Kinematics. By the end, the application will have a large crowd of animated people, who are the inhabitants of your virtual world. In addition, the window will have fancy UI elements that you can use to control the animations of the characters, and you will learn how to debug the application if you encounter any trouble, both on the CPU and the GPU. I hope you enjoy the ride – it will take you to various wonderful locations, steep hills, long roads, and nice cities. Buckle up!
To begin, welcome to Chapter 1! The first step might be the most important as it sets the foundation for all the other chapters in this book. Without a window to your virtual world, you won’t be able to see your creations. But it’s not as hard as you might expect, and the right tools can solve this quickly and easily.
As we are using open source software and platform-independent libraries in this book, you should be able to compile and run the code “out of the box” on Windows and Linux. You will find a detailed list of the required software and libraries in the Technical requirements section.
To that end, in this chapter, we will cover the following topics:
- Creating your first window
- Adding support for OpenGL or Vulkan to the window
- Event handling in GLFW
- The mouse and keyboard input for the game window