xl_cheese
January 12th, 2008, 12:34 AM
I can't figure out how to use the nanosleep function when drawing with the cairo lib.
Basically I want to draw a line, sleep ~.5s, and then draw another line. What I'm seeing is there is no delay at all. Both lines are drawn at the same time.
Any help would be appreciated and I'll note that I'm a total coding noob so if you could dumb it down for that that would be great.
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius+1, params->corners);
ge_shade_color (¶ms->parentbg, 0.96, &glow);
ge_cairo_set_color (cr, &glow);
cairo_stroke (cr);
nanosleep (500000000, NULL);
ge_cairo_rounded_rectangle (cr, 1, 1, width-2, height-2, radius+1, params->corners);
ge_shade_color (¶ms->parentbg, 0.92, &glow);
ge_cairo_set_color (cr, &glow);
cairo_stroke (cr);
Thanks!
Basically I want to draw a line, sleep ~.5s, and then draw another line. What I'm seeing is there is no delay at all. Both lines are drawn at the same time.
Any help would be appreciated and I'll note that I'm a total coding noob so if you could dumb it down for that that would be great.
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius+1, params->corners);
ge_shade_color (¶ms->parentbg, 0.96, &glow);
ge_cairo_set_color (cr, &glow);
cairo_stroke (cr);
nanosleep (500000000, NULL);
ge_cairo_rounded_rectangle (cr, 1, 1, width-2, height-2, radius+1, params->corners);
ge_shade_color (¶ms->parentbg, 0.92, &glow);
ge_cairo_set_color (cr, &glow);
cairo_stroke (cr);
Thanks!