Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    How rendering with opengl works

    I have some difficulties understanding how rendering works on linux, so let's assume that I use nvidia's opengl implementation and driver.

    Now if I write an opengl program, I assume it goes something like this:
    1: My program calls opengl functions in
    2: uses the nvidia driver to draw to the screen.
    ^ Is that correct so far? If it is, I don't see X11's role in this, but for some reason opengl needs X to work.
    So could someone explain X's role in this process?
    Why can't I draw directly to the screen without the use of X11?
    And if opengl needs X11, how does X11 draw to the screen?

    I already tried googling but none of the sites explain my question.
    I'd like to have some flow chart on what depends on what and who calls who, etc...

    -- Thanks to anyone who want's to help me on this

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Harrow, UK
    i think X11 is the top-level manager for your desktop. It talks to the keyboard, mouse and video card directly, not through the kernel like other programs, so it needs drivers for them. Your video card driver is a module of the X-server.

    But video cards vary a lot in what they can do. Some can do high-level rendering directly, using built-in firmware. Others can only do primitives and need to be controlled by the cpu. Applications don't know what kind of card you have, so they use openGL functions. X includes an openGL server module that intercepts those calls and redirects them appropriately; directly to the card if it can carry out the instruction - if not, to the cpu, which carries out the equivalent operation using the mesa library.

    At least I think that's how it works.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  3. #3
    Makes sense, ty.
    More info is always welcome.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts