0

I'm trying to understand how this works. So there are 2 types of applications - X apps and OpenGL apps. X apps draw to the screen using Xlib but do OpenGL somehow bypass X completely and render directly to the GPU? How does it do that?

If both X and OpenGL are running - how does my computer know which one to render to the screen? Is there some priority level? While X is running, can I bypass it and draw over it? That seems to be what OpenGL apps are doing if I understand it correctly.

1
  • There are some nice diagrams on wikipedia aiglx showing the progression of direct rendering. It needs a Direct Rendering Manager, see DRM.
    – meuh
    May 7 at 12:08
0

OpenGL apps do not "bypass X", they ask X to provide a surface, and draw on it. Then X decides how to project that surface to the screen. Sometimes, if the app has frozen, you can see the surface when moving the windows, as a bright green rectangle.

You could draw directly on the screen before. However, now we have compositing window managers which, in a sense, do it themselves. So, while the API to draw on screen is likely still available, the WM will simply overpaint your stuff, 60 times per second.

2

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.