On Mon, Feb 27, 2012 at 11:32 AM, David Jackson <djackson...@gmail.com> wrote:
> How does a wayland app do that? How does a wayland app tell the GPU to
> render a square 30x30 at coordinate 40x40? Keep in mind, there are many
> different manufacturers of GPUs and each may have different bugs and
> differences in the interface to the hardware, if not a completely different
> hardware interface, and an application is not going to know about every GPU
> that exists.

These are OpenGL commands to render a square:

glColor4f(r, g, b, alpha);
glBegin(GL_QUADS);
    glVertex2f(-1, -1);
    glVertex2f( 1, -1);
    glVertex2f( 1,  1);
    glVertex2f(-1,  1);
glEnd();

Obviously you would change the vertex locations to match where you
want the thing. OpenGL is quite sophisticated, and you need to do a
lot of setup work before making these calls (alpha-blending mode and
so forth), but this is the basic idea.

All these OpenGL functions come from the Mesa library. Depending on
the hardware, Mesa will either perform these drawing commands in
software or send them off to the GPU. The client application doesn't
need to care about the difference.

-William
_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to