What does a video card do? What is DirectX and X11?

Discussion in 'NZ Computing' started by darkknight, Jan 27, 2006.

  1. darkknight

    darkknight Guest


    What does a video card do?

    The code being executed in the main CPU (not the video card) determines
    what appears on the screen i.e. what the colour each of the one million
    or so pixels on the screen should be. Where does it put this

    What does an expensive video card do better than a cheap video card?

    What is DirectX, SDL or X11?

    If a program in the main CPU wants to draw a red rectangle on the
    screen, why can't it just write
    for (x=100; x<=200; ++x) SetPixel(x,300,red);
    for (x=100; x<=200; ++x) SetPixel(x,500,red);
    for (y=300; y<=500; ++y) SetPixel(100,y,red);
    for (y=300; y<=500; ++y) SetPixel(200,y,red);

    What do you need DirectX for?

    darkknight, Jan 27, 2006
    1. Advertisements

  2. darkknight

    nick Guest

    Program says "draw a rectanglle, then rotate it in 3 dimensions to 45
    degrees then put a realistic texture on it"

    This can be done by the central processing unit (Cpu) or the graphics
    processing unit (Gpu), depending on the Gpu capabilites and the drivers
    used. The Gpu is designed to do graphics functions very fast, the Cpu
    will generally not be tuned to do those things fast, and also has to do
    other stuff.

    DirectX and SDL are doors to the video (and audio) hardware, they
    provide a framework for accessing the fast stuff in the Gpu.

    X11 is a graphics system which is common in unix systems (but also
    works on windows, MacOSX, IRIX, Sparc and others). It is a client
    server system, the server is the set of drivers that put stuff onto a
    display. The client is the user program that displays on a server. The
    client and the server are usually on the same machine, but don't have
    to be, which means X11 can work over networks (a program on my work
    computer can display on my home computer).
    nick, Jan 27, 2006
    1. Advertisements

  3. darkknight

    darkknight Guest


    So do all video cards have the same interface and commands or does
    DirectX have to know how to drive lots of different video cards?

    Does X11 use the "extra" capabilities of the GPU or does it just send
    basic SetPixel type commands to the GPU - or is there another layer
    between X11 and the video card?

    With an application such as Windows explorer, that just draws static
    images, would the GPU be doing anything more than just accepting
    SetPixel commands?

    darkknight, Jan 27, 2006
  4. darkknight

    nick Guest

    You are probably getting to the limit of my technical expertise, but
    I'll have a go. No warranty blah blah

    video cards have different commands - thats why either the manufacturer
    makes a driver, or someone reverse engineers one.

    Whether X11 implements extra capabilities depends on the state of
    driver development for that card. eg nVidia provide (closed source) X11
    drivers that implement most of the features of their cards (2d and 3d
    acceleration, XvMC, etc). Some other manufacturers will not release
    enough specs, or put the effort in, to get it working. Also X11 is a
    standard, there are more than one implementations. The popular open
    source implementation is xorg-x11 and you will now find that in most
    linux distributions. There are also commercial X11 implementations.

    As for windows explorer, i am not sure about the answer to your
    question. However it is the graphics subsystem that draws on the
    screen, not explorer. explorer tells another part of the operating
    system to draw something, and that is done in combination between the
    cpu and the gpu, quite how the system knws what stuff can (and should)
    be offloaded to the gpu, and which has to be crunched in the cpu, i do
    not know. I suspect that explorer would be written to run everywhere,
    and wouldn't be dependent on fancy graphics capabilities.
    nick, Jan 27, 2006
  5. darkknight

    Murray Symon Guest

    There is a driver layer between them. Each card has its own driver.
    DirectX provides an abstracted API to the application program.
    As far as I can recall, DirectX will emulate in software any functions
    that are not supported in the card's hardware.
    Some X11 drivers support different degrees of hardware acceleration.
    Many support full 2D acceleration. X11 uses "DRI" for 3D graphics.
    refer http://xfree86.org/ and http://freedesktop.org/Software/xorg
    Yes, 2D acceleration (in the GPU) can be used for bitblit operations as
    many windows functions are operating on rectangular areas. e.g. it is more
    efficient to get the GPU to move a rectangular window from one position to
    another via a hardware-assisted bitblit than by getting the CPU to move
    each pixel on an individual basis.
    You can verify this by disabling Video Acceleration in your Windows
    settings in control panel, and observing the difference (if any).
    Murray Symon, Jan 28, 2006
  6. darkknight

    Gordon Guest

    Makes better (more complex) moving pictures.
    Gordon, Jan 28, 2006
  7. darkknight

    darkknight Guest

    Thanks guys.

    darkknight, Jan 28, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.