A simple orange client surface with a simple grey tooltip
#include <stdio.h>
#include <unistd.h>
#include <GLES2/gl2.h>
{
GLfloat r, g, b, a;
int main(
int argc,
char *argv[])
{
Color const orange = {0.866666667f, 0.282352941f, 0.141414141f, opacity};
return 1;
glClearColor(orange.r, orange.g, orange.b, orange.a);
glClear(GL_COLOR_BUFFER_BIT);
MirSurface* tooltip = create_tooltip(connection, parent, select_pixel_format(connection));
{
}
return 0;
}
{
unsigned int nformats;
for (unsigned int f = 0; f < nformats; f++)
{
if (opaque)
{
pixel_format = format[f];
break;
}
}
return pixel_format;
}
{
int const width = 50;
connection, width, height, format, parent, &zone);
for (
int y = 0; y != buffer.
height; ++y)
{
for (
int n = 0; n != buffer.
width; ++n)
switch (format)
{
{
uint32_t*
const pixel = (uint32_t*) (buffer.
vaddr + y * buffer.
stride);
pixel[n] = 0xff7f7f7f;
break;
}
{
uint32_t*
const pixel = (uint32_t*) (buffer.
vaddr + y * buffer.
stride);
pixel[n] = 0x007f7f7f;
break;
}
{
uint8_t*
const subpixel = (uint8_t*) (buffer.
vaddr + y * buffer.
stride);
subpixel[3 * n + 0] = 0x7f;
subpixel[3 * n + 1] = 0x7f;
subpixel[3 * n + 2] = 0x7f;
break;
}
default:
break;
}
}
return tooltip;
}
Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016