Mail Archives: djgpp/1997/08/23/05:29:50
> After hacking up some code for using the mouse, in polled mode, I was
> horrified by the amount of flicker. Can someone post interrupt driven or
> some flicker free mouse code for GRX v2? Here's what I got:
[snip]
>
> while (!(MS.buttons & GR_M_RIGHT))
> {
> GrMouseGetEvent(GR_M_POLL, &MS);
> if (MS.buttons & GR_M_LEFT)
> GrPlot(MS.x, MS.y, 15);
> }
>
[snip]
For flicker free mouse you should hide mouse before your drawing
because if you do not this GRX will hide/show mouse evertime when you
call draw functions. E.g. :
> while (!(MS.buttons & GR_M_RIGHT))
> {
> GrMouseGetEvent(GR_M_POLL, &MS);
> if (MS.buttons & GR_M_LEFT)
{
GrEraseMouseCursor();
// DO some drawings
> GrPlot(MS.x, MS.y, 15);
GrDisplayMouseCursor();
}
> }
And if you drawing is big (e.g more 10 draw calls at one time) this
trick not only kill flicks but dramastically speed graphics output.
I beleive that this GrPlot call not the one call in this cicle in your
real program :)
--
Alexander Bokovoy, <bokovoy AT bspu DOT ac DOT by>
---== The Soft Age coming soon ==---
- Raw text -