concerns over wayland and need for wayland app display to X Server

William Swanson swansontec at gmail.com
Mon Feb 27 12:02:39 PST 2012


On Mon, Feb 27, 2012 at 11:32 AM, David Jackson <djackson452 at 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


More information about the wayland-devel mailing list