From the course: Learning OpenGL

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Creating a context and getting version info

Creating a context and getting version info - OpenGL Tutorial

From the course: Learning OpenGL

Start my 1-month free trial

Creating a context and getting version info

In this lesson, we'll examine how to us GLFW to initialize an open GL context, and then, how to query OpenGL to find out what version of it is running on your graphics card. OpenGL itself is strictly a graphics API. It doesn't include any commands for opening or closing a window on your platform's desktop. That is, it requires us to establish a context. So, what is a GL context? A GL context is a platform-specific object, which contains and enables OpenGL's functionality. This varies from platform to platform, which is why we use libraries such as GLFW for managing window contexts. We can also think of OpenGL context as a window. You can have many windows on your screen, so we need to pick one to be the current context. That's pretty much all we need to know right now to get started. So let's take a look at the code. On line 20, we include the standard library. This is something that we need to use in Visual Studio. On lines 21 and 22, we include something called Glue. Glue is…

Contents