Flush output on X11

Andrew Bell <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CACJ51z1ht5qd4cFxBJ_Pfo+EhYLVNqjigja22WVLSBGHpLrL0Q@mail.gmail.com>
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
[email protected]

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.