Are there any benefits to using Windows window for OpenGL or Vulkan rendering, rather than using GLFW window?

Is there any performance hits when using C++ Window creation over GLFW since it provides OpenGL and Vulkan interface?

  • 2
    \$\begingroup\$ It's worth noting that, even though I haven't checked the source, libraries like GLFW are used primarily to support multiple platforms, and on windows it is likely using the same function behind the scenes to open a new window. So there shouldn't be any noticeable performance difference. \$\endgroup\$ Commented Feb 24, 2020 at 8:57
  • \$\begingroup\$ This does not look like a source of concern, unless you plan on creating too many windows. \$\endgroup\$
    – Theraot
    Commented Feb 24, 2020 at 19:57

1 Answer 1


It depends

GLFW is just a wrapper around the Windows API calls, so whether you create a window using GLFW or create one using the API, the same calls are ultimately being made.

However, a wrapper such as GLFW can be expected to be robust, to do error-checking, to select optimal formats, and so on, which you may not do if you just wrote the code yourself. So your own code may be faster at creating a window, but it may also be more likely to do the wrong thing.

At this stage you really need to read the OpenGL wiki Getting Started pages to gain an understanding of the process of initializing OpenGL.

But ultimately, what does it matter? Creating a window is milliseconds at the beginning of your application, and once the window is created OpenGL takes over, so it does not matter how it was created - all other things being equal (pixel formats, hardware acceleration, etc) the performance of OpenGL in your program will be identical.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .