[comp.windows.x] How do you move a filled-rectangle without flickering?

neopand@prism.CS.ORST.EDU (05/15/91)

I did it by first drawing a filled rectangle, drawing the rectangle
in next location(one pixel ahead), and then erasing the old one. But
it gives a flickering effect as it moves.

I wonder if somebody out there knows a better way to do this without
the flickering effect.

Thank you.

-DN

_______________________________________________________________
| Deepak Neopane          | INTERNET:neopand@prism.cs.orst.edu|
| 618 Finley Hall, OSU    | BITNET  :neopaned@orstvm.bitnet   |
|_Corvallis,_OR 97331-1208|_503-737-8633______________________|

amotz@amil.co.il (Amotz Maimon) (05/15/91)

>> I did it by first drawing a filled rectangle, drawing the rectangle
>> in next location(one pixel ahead), and then erasing the old one. But
>> it gives a flickering effect as it moves.
>> 
>> I wonder if somebody out there knows a better way to do this without
>> the flickering effect.
>> 

In the MIT distribution there's a `multi buffer' extension of the server. The
idea is the you draw in a hidden buffer(s) and switch the buffers. Since all that
is handled by the server (Possibly using hardware support for it), it works
pretty fast. We started using it lately, and early tests seems to be working
fine. The extension is in:

	.../mit/extensions/server/multibuf.c

Hope it helps. If you find any alternative solution, I'd like to hear about
it.

Amotz.


-----------------------------------------------------------------------------
| Amotz   Maimon  				Internet: amotz@amil.co.il  |
| Applied Materials (Israel) LTD.		Fax: +972-3498-078          |
| P.O. Box 58039 / M.S. 0033     		Phone: +972-3498-201        |
| Santa Clara, CA, 95052-8039                                               |
-----------------------------------------------------------------------------