0
\$\begingroup\$

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?

\$\endgroup\$
2
  • 1
    \$\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\$ – TomTsagk Feb 24 '20 at 8:57
  • \$\begingroup\$ This does not look like a source of concern, unless you plan on creating too many windows. \$\endgroup\$ – Theraot Feb 24 '20 at 19:57
4
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.