Telling GLFW we want to use the core-profile means we'll get access to a smaller subset of OpenGL features without backwards-compatible features we no longer need. We also tell GLFW we want to explicitly use the core-profile. We set the major and minor version both to 3. This ensures that when a user does not have the proper OpenGL version GLFW fails to run. This way GLFW can make the proper arrangements when creating the OpenGL context. Since the focus of this book is on OpenGL version 3.3 we'd like to tell GLFW that 3.3 is the OpenGL version we want to use. If you try to run the application now and it gives a lot of undefined reference errors it means you didn't successfully link the GLFW library. A list of all the possible options and its corresponding values can be found at GLFW's window handling documentation. The second argument is an integer that sets the value of our option. The first argument of glfwWindowHint tells us what option we want to configure, where we can select the option from a large enum of possible options prefixed with GLFW_. In the main function we first initialize GLFW with glfwInit, after which we can configure GLFW using glfwWindowHint. glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE) GlfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE) GlfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3) GlfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3) Next, we create the main function where we will instantiate the GLFW window: The include file for GLAD includes the required OpenGL headers behind the scenes (like GL/gl.h) so be sure to include GLAD before other header files that require OpenGL (like GLFW). cpp file and add the following includes to the top of your newly created file.īe sure to include GLAD before GLFW. Let's see if we can get GLFW up and running. Hello Window Getting-started/Hello-Window