Using the GLFW library
The GLFW
library hides all the complexity of creating windows, graphics contexts, and surfaces and getting input events from the operating system. In this recipe, we build a minimalistic application with GLFW to get an empty window onto the screen.
Getting ready
We build our examples with GLFW 3.4. Here is a JSON snippet for the Bootstrap script so that you can download the proper library version:
{
"name": "glfw",
"source": {
"type": "git",
"url": "https://github.com/glfw/glfw.git",
"revision": "3.4"
}
}
The complete source code for this recipe can be found in the source code bundle under the name of Chapter01/02_GLFW
.
How to do it...
Let’s write a minimalistic application that creates a window and waits for an exit command from the user – pressing the Esc key. This functionality will...