[cairo] Flush output on X11
Andrew Bell
andrew.bell.ia at gmail.com
Sun Jan 27 10:57:53 PST 2013
Hi,
Just starting with cairo and haven't done X11 in years. I'm trying to make
sure that output gets flushed to the output window when I'm not running an
active event loop - just trying to display the output of some processing as
it occurs. Here's the code - it just draws hexagons that have some X/Y
position. If I call this code once and then get start an infinite loop, I
get no output. If I call this code in an infinite loop, I get a hexagon
drawn. What do I need to do to make sure that output is flushed on demand?
pos.m_x = hex_p->x() * m_grid_p->width();
pos.m_y = hex_p->y() * m_grid_p->height();
if (hex_p->xodd())
{
pos.m_y += (m_grid_p->height() / 2);
}
cairo_move_to(m_cairo_p, pos.m_x, pos.m_y);
for (int i = 1; i <= 5; ++i)
{
Point p = pos + m_grid_p->offset(i);
cairo_line_to(m_cairo_p, p.m_x, p.m_y);
}
cairo_close_path(m_cairo_p);
cairo_stroke(m_cairo_p);
cairo_surface_flush(m_surface_p);
XFlush(m_dpy_p);
Thanks,
--
Andrew Bell
andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20130127/24e9db7a/attachment.html>
More information about the cairo
mailing list