linux – OpenGL, GLFW и swapBuffers


There is a code like this:

GLFWwindow* window = glfwCreateWindow(/*параметры*/); glfwSwapBuffers(window);

So, I'm wondering what the front and back buffers of the window are, and what happens from the operating system's point of view when glfwSwapBuffers() called.

As I understand it, the OS, for example linux, uses OpenGL to render all its windows and UI elements, and it turns out that the output of my application to a window is essentially rendering the FrameBuffer with a texture into the rectangle of the created window. So? Are there any resources where I can find out how this works at the system level?

And yes, I know what double buffering is for, I'm interested in exactly how the buffer is output to the system window, and what is controlled by the system in this process, and what is controlled by the video card


glfw is a library for working with windows in a cross-platform manner, providing the programmer with a single API and it does not depend on openGL directly, it is just a wrapper, because all the work related to displaying graphic information is done by the OS communicating with the video card through drivers, but how are they there communicate – you need to ask the OS developers or dig into the appropriate source codes for the OS (I'm sure you haven't tried it yet).

Scroll to Top